• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UIModalPresentationFormSheet on iPad and iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UIModalPresentationFormSheet on iPad and iPhone


  • Subject: UIModalPresentationFormSheet on iPad and iPhone
  • From: Andreas Falkenhahn <email@hidden>
  • Date: Mon, 02 Jan 2017 17:59:58 +0100

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


  • Follow-Ups:
    • Re: UIModalPresentationFormSheet on iPad and iPhone
      • From: Andreas Falkenhahn <email@hidden>
  • Prev by Date: Re: NSTouchBar in Carbon
  • Next by Date: 12 hr vs 24 hr time display
  • Previous by thread: Re: NSTouchBar in Carbon
  • Next by thread: Re: UIModalPresentationFormSheet on iPad and iPhone
  • Index(es):
    • Date
    • Thread