/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (void)loadView { PurchaseWindowViewController* vc = [[PurchaseWindowViewController alloc] initWithNibName:@"PurchaseWindowViewController" bundle:nil]; pc = [[UIPopoverController alloc] initWithContentViewController:vc]; CGRect rect = CGRectMake((self.view.bounds.size.width - 300)/2, (self.view.bounds.size.height - 400)/2, 300, 400); pc.popoverContentSize = rect.size; [pc presentPopoverFromRect:rect inView:self.view permittedArrowDirections:0 animated:YES]; [super viewDidLoad]; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { CGRect rect = CGRectMake((self.view.bounds.size.width - 300)/2, (self.view.bounds.size.height - 400)/2, 300, 400); pc.popoverContentSize = rect.size; }