I have a UITableViewController that I am trying to display in a UIPopoverController. No matter what do, the tableview is always displayed at full size within the popover.
In my StoryBoard I’ve set the UITableViewController‘s Size to Freeform. I’ve explicitly set the UITableView‘s height and width in the Size inspector.
Here is how I setup the controller and popover:
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard-iPad" bundle:nil];
self.settingsController = [sb instantiateViewControllerWithIdentifier:@"SettingsViewControllerID"];
self.settingsPopover = [[UIPopoverController alloc] initWithContentViewController:_settingsController];
I’ve also tried setting the controller’s popover size explicitly:
self.settingsController.contentSizeForViewInPopover = CGSizeMake(400.0, 400.0);
When I run the app and activate the popover – it is almost as tall as the main screen.
Am I missing something obvious here?
Thanks in advance,
CS
The UITableViewController always wants to be the full size of the window, or popover (which is a special kind of window). If you want a smaller table view, use a UIViewController instead as the content controller of your popover. You should then be able to resize it in IB.