changing the size of the popover controller when pushing navigation view controller in popover on iPad

StackOverflow https://stackoverflow.com/questions/17170914

Question

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];
Was it helpful?

Solution

Try this....

- (void)viewWillAppear:(BOOL)animated
{
   CGSize size = CGSizeMake(320, 845); // size of view in popover
   self.contentSizeForViewInPopover = size;
   [super viewWillAppear:animated];
}

OTHER TIPS

That's not going to work for iOS 7.

popoverController.popoverContentSize = CGSizeMake(320, 845);

is what you're looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top