user520300
user520300

Reputation: 1527

UIPopoverController not sizing correctly in iOS 8

Prior to iOS 8 my app using UIPopoverController was working fine. I had it anchored and opening up at a size of 400 x 215. However now when i run my app on iPad using iOS 8 my popover window is not sized properly. Its almost popping up at the full height and width off my anchor. Since iOS is so new i can't seem to find an adjustment for this. Below is my code:

UIView *anchor = self.personAnchor;
        UIViewController *viewControllerForPopover =
        [self.storyboard instantiateViewControllerWithIdentifier:@"choosePersonViewController"];


        popover = [[UIPopoverController alloc]
                   initWithContentViewController:viewControllerForPopover];
        popover.popoverContentSize = CGSizeMake(400, 215);
        popover.delegate = self;
        [popover presentPopoverFromRect:anchor.frame
                                 inView:anchor.superview
               permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

Upvotes: 5

Views: 1308

Answers (1)

gndp
gndp

Reputation: 229

Set the view controller's preferredContentSize instead of setting the popover's popoverContentSize - copied from comment

Upvotes: 5

Related Questions