3

I want to show a popover with a custom contentsize. I can do it doing like so

UINavigationController* popoverContent = [[UINavigationController alloc] init]; UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 800, 800)]; popoverView.backgroundColor = [UIColor blueColor]; popoverContent.view = popoverView; popoverContent.contentSizeForViewInPopover = CGSizeMake(55, 55); UIPopoverController *pop = [[UIPopoverController alloc] initWithContentViewController:popoverContent]; [pop presentPopoverFromRect:CGRectMake(80.0, 210.0, 160.0, 40.0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES]; 

but if I change the content to :

popoverContent.viewControllers = [NSArray arrayWithObject:myViewController]; 

the

popoverContent.contentSizeForViewInPopover = CGSizeMake(55, 55); 

the size doesn't change at all.

How can I change the content size while using the navigation controller? Thanks

1
  • 2
    This is breaking my balls too. What the hell is up with it? Commented Oct 21, 2010 at 5:20

1 Answer 1

4

Explicitly changing the popovers size works:

 [self.popoverController setPopoverContentSize:myView.size animated:YES]; 

But I agree that contentSizeForViewInPopover should work. It doesn't for me anyway.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.