Re: UIModalPresentationFormSheet on iPad and iPhone
Re: UIModalPresentationFormSheet on iPad and iPhone
- Subject: Re: UIModalPresentationFormSheet on iPad and iPhone
- From: Andreas Falkenhahn <email@hidden>
- Date: Tue, 03 Jan 2017 10:47:33 +0100
Solved this now. Of course I can just add all the GUI controls to another subview
and then center this subview in the root view's frame. This makes the GUI look
good on both iPad and iPhone.
On 02.01.2017 at 17:59 Andreas Falkenhahn wrote:
> 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@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden