As described in the docs, view controllers that have their modalPresentationStyle set to UIModalPresentationFormSheet open in a popover over the presenting view controller on iPad whereas on iPhone they often (but not always) appear full screen.
Since I don't use Interface Builder/Storyboards to create my GUI but instead initialize it manually viewDidLoad(), I need to find a way to deal with this situation. On the iPad everything is nice: I set preferredContentSize to the desired size and then do the layout in viewDidLayoutSubviews() and everything appears nicely centered on screen. On the iPhone, however, it looks quite ugly because the GUI now appears in the top-left corner with lots of space to the bottom and to the right of the GUI. In order to make this look nicer, I guess I'd have to center all my subviews in viewDidLayoutSubviews() manually. But this is of course quite some work so I am wondering whether there isn't an easier solution to this? Also, how do I detect in viewDidLayoutSubviews() or viewDidLayout() whether the view controller is being shown as a popover (as on iPad) or in fullscreen mode (as on iPhone)? -- Best regards, Andreas Falkenhahn mailto:[email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
