UIPopover Sizing

Posted by Echilon on Stack Overflow See other posts from Stack Overflow or by Echilon
Published on 2012-03-12T19:31:22Z Indexed on 2012/04/13 11:29 UTC
Read the original article Hit count: 265

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios