Show UIPopoverController


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. - (void)loadView
  2. {
  3. PurchaseWindowViewController* vc = [[PurchaseWindowViewController alloc] initWithNibName:@"PurchaseWindowViewController" bundle:nil];
  4.  
  5. pc = [[UIPopoverController alloc] initWithContentViewController:vc];
  6.  
  7. CGRect rect = CGRectMake((self.view.bounds.size.width - 300)/2, (self.view.bounds.size.height - 400)/2, 300, 400);
  8. pc.popoverContentSize = rect.size;
  9.  
  10. [pc presentPopoverFromRect:rect inView:self.view permittedArrowDirections:0 animated:YES];
  11.  
  12. [super viewDidLoad];
  13.  
  14. }
  15.  
  16. - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
  17. {
  18. CGRect rect = CGRectMake((self.view.bounds.size.width - 300)/2, (self.view.bounds.size.height - 400)/2, 300, 400);
  19. pc.popoverContentSize = rect.size;
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.