- position of UIPopoverController in iPad
- -(IBAction)product2_click_h2
- {
- //build our custom popover view
- UIViewController* popoverContent2 = [[UIViewController alloc]
- init];
- UIView* popoverView2 = [[UIView alloc]initWithFrame:CGRectMake(100,100,200,200)];
- popoverView2.backgroundColor = [UIColor greenColor];
- UITextView *prod2_info = [[UITextView alloc]initWithFrame:CGRectMake(5,5,390,290)];
- [prod2_info setFont:[UIFont fontWithName:@"Arial" size:15]];
- [popoverView2 addSubview:prod2_info];
- [prod2_info setEditable:NO];
- prod2_info.text = @"n"
- " Higher Mileage Motor Oil :n "
- " --------------------------------------nn"
- " --> MaxLife NextGen Higher Mileage Motor Oil nn"
- "- Special seal conditioners rejuvenate sealsn"
- " within the engine block to help n"
- " prevent oil leaks that lead to sludge and deposits.n"
- "- Anti-oxidant additives reduce oil viscosity breakdownn"
- " to help prevent engine clogging sludge and deposit formation. n"
- "- Detergents chemically bond with and remove existingn"
- " sludge and depositsn"
- "- Additional friction-reducing additives help reduce abrasion within enginen"
- "- Anti-wear agents help prevent engine damage n"
- "- Available in the following viscosity grades n"
- " - 5W-30 n "
- " - 10W-30 n ";
- prod2_info.scrollEnabled =YES;
- popoverContent2.view = popoverView2;
- popoverContent2.contentSizeForViewInPopover = CGSizeMake(400,300);
- //create a popover controller
- self.popovercontroller_2 = [[UIPopoverController alloc]
- initWithContentViewController:popoverContent2];
- //present the popover view non-modal with a
- //refrence to the button pressed within the current view
- [self.popovercontroller_2 presentPopoverFromRect:product2.frame
- inView:self.view
- permittedArrowDirections:UIPopoverArrowDirectionAny
- animated:YES];
- }
- [self.popovercontroller_2 presentPopoverFromRect:product2.frame
- inView:self.view
- permittedArrowDirections:UIPopoverArrowDirectionAny
- animated:YES];
- [self.popovercontroller_2 presentPopoverFromRect:product2.frame
- inView:**button.bounds**
- permittedArrowDirections:UIPopoverArrowDirectionAny
- animated:YES];