Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the size of MasterViewController when fired as a popover

When using a spilt view controller, I have a Master and Detail View. When the iPad is in Portrait mode, the master view is displayed as a popup. How can I adjust the height of the masterview (popup view)? I have tried:

 self.contentSizeForViewInPopover = CGSizeMake(320.0, 2 * 52.0); 

But I am not sure were to set this?

enter image description here

like image 661
PhillyNJ Avatar asked Mar 31 '12 12:03

PhillyNJ


1 Answers

You used to be able to set the size in viewDidLoad using contentSizeForViewInPopover. But in iOS 5.1, the presentation style of the master view controller was changed to slide in rather than appear as a standard popover. As far as I can tell, it still is a UIPopover, but we can no longer modify its size. I tried contentSizeForViewInPopover on the view, as well as setPopoverContentSize on the popover as suggested on the developer forums, and neither had any effect.

The UISplitViewController class reference doesn't acknowledge this change, nor do the class references for UIViewController or UIPopoverController, and the View Controller Programming Guide still shows the old style of the master view controller popover.

You could try changing the height of the table view inside your detail view, and then hide the popover's background. I haven't tried this myself.

Also, since your detail view is showing a map, you might want to disable the right-swipe gesture that now invokes the master view, to prevent that from interfering with the map gestures.

like image 99
arlomedia Avatar answered Nov 19 '22 17:11

arlomedia