Reputation: 5384
I am new in ios developement.I have a main viewController having navigation items while i tap navigation item popover viewcontroller appears fine and gettig exact contentSize For View In Popover(320,845), the problem is when i tap button inside the popover viewcontroller popover Contentsize has to be changed.
UIBarButtonItem *btn = (UIBarButtonItem *)sender;
Agamam *agamamView = [[Agamam alloc] initWithNibName:@"Agamam" bundle:nil];
agamamView.delegate=self;
agamamView.contentSizeForViewInPopover =CGSizeMake(agamamView.view.frame.size.width, agamamView.view.frame.size.height);
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:agamamView];
popAgamamView = [[UIPopoverController alloc] initWithContentViewController:navController];
[popAgamamView presentPopoverFromBarButtonItem:btn permittedArrowDirections:YES animated:YES];
Upvotes: 3
Views: 4548
Reputation: 512
That's not going to work for iOS 7.
popoverController.popoverContentSize = CGSizeMake(320, 845);
is what you're looking for.
Upvotes: 6
Reputation: 1043
Try this....
- (void)viewWillAppear:(BOOL)animated
{
CGSize size = CGSizeMake(320, 845); // size of view in popover
self.contentSizeForViewInPopover = size;
[super viewWillAppear:animated];
}
Upvotes: 6