Resize MasterViewController at startup as a popover

When using a spilled view controller, I have a Wizard and a Detailed view. When the iPad is in Portrait mode, the main view appears as a pop-up window. How to adjust the height of the main view (popup)? I tried:

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

But I'm not sure to install this?

enter image description here

+7
source share
2 answers

Previously, you could set the size in viewDidLoad using contentSizeForViewInPopover. But in iOS 5.1, the presentation style of the main view controller was changed to a slide, and not like a standard popover. As far as I can tell, it is still UIPopover, but we can no longer resize it. I tried contentSizeForViewInPopover in the view, as well as setPopoverContentSize on popover as suggested on the developer forums , and none of them had any effect.

the reference to the UISplitViewController class does not confirm this change, as well as the class references for the UIViewController or UIPopoverController , and the View Controller Programming Guide still shows the old style of the main view controller.

You can try changing the height of the table view inside your detailed view, and then hide the background . I have not tried this myself.

In addition, since the map is displayed in your detailed view, you can turn off the right-hand gesture, which now invokes the master view , so that this does not interfere with the gestures of the map.

+5
source

I saw that Apple samples use the awakeFromNib method of the master view controller as well as viewDidLoad. I am not sure that there is one reason for choosing one or the other.

0
source

All Articles