Posted By

streamt on 03/04/11


Tagged

c iphone objective iPad UIPopoverController


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tintenklecks
cnathan


Show UIPopoverController


 / Published in: Objective C
 

  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  

You need to login to post a comment.