Question

I have a UIPopoverController which I'm trying to show from a UIBarButtonItem in a navigation bar. Despite setting the resizing mask for the tableview inside the popover's content viewController, it takes up the whole height of the screen. The only thing which has any effect on the content size is menuPopover.contentViewController.view setFrame:CGRect. I'm using the code below to show the popover inside the left hand side of a UISplitViewController

    // menuPopover and editVc are properties on the parent viewController
    menuPopover = [[UIPopoverController alloc] initWithContentViewController:editVc];
    [menuPopover presentPopoverFromBarButtonItem:btnMenu permittedArrowDirections:UIPopoverArrowDirectionAny animated:true];
    [menuPopover setPopoverContentSize:CGSizeMake(400, 500) animated:true];
    [menuPopover.contentViewController.view setFrame:CGRectMake(0,0,400, 500)];

Yet this is what I'm seeing. The arrow shows where the menu button was which showed the popover:

http://imageshack.us/photo/my-images/545/screenshot20120312at191.png/

It's as though the content view is just expanding vertically.

Was it helpful?

Solution

The solution was to set the transition to Popover in IB, the set the size of the view within the storyboard. Use explicit size should be unchecked for the popover ViewController.

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