Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad launch orientation not detected
    primarykey
    data
    text
    <p>I have an iPad app that works correctly except for an odd issue during launch. I've read several questions &amp; answers regarding orientation, but this still has me stumped.</p> <p>The root view controller is a UITabBarController with 3 tabs. Two of the tabs are have custom view controllers (one based off of UIViewController, the other off of UITableViewController) and both suffer from this launch orientation problem. The third tab is a custom UITableViewController that's embedded in a UINavigationController.</p> <p>OK, here's the problem. If I start the app in Portrait orientation, everything works great. If I start it in Landscape orientation, the 3rd tab works perfectly. However, the first 2 tabs come up in Portrait orientation, even though:</p> <ol> <li>The status bar orientation correctly shows as landscape (spread across the screen).</li> <li>The Tab Bar view correctly shows as landscape with the tabs centered.</li> <li>All views return YES for shouldAutorotateToInterfaceOrientation for all orientations.</li> </ol> <p>If I call [self interfaceOrientation] or [[UIApplication sharedApplication] statusBarOrientation] in the view controller's viewWillAppear, then the 3rd tab's view controller reports 3 (landscape) but the first two view controllers report 1 (portrait) even though the status bar is clearly landscape!</p> <p>If I rotate the iPad to portrait and back to landscape, then all 3 tabs' views rotate correctly (and the methods above return 3, as expected).</p> <p>Also, if I tap on any other tab and then back on tab #1 or #2, then they will now rotate correctly, even without rotating the iPad itself!</p> <p>What am I missing?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload