The actual title for this question is longer than I can possibly fit:
Launching an app whose root view controller only supports portrait-orientation but which otherwise supports landscape orientations on an iPhone 6 Plus while the home screen is in a landscape orientation results in a limbo state where the app's window is in a landscape orientation but the device is in a portrait orientation.
In short, it looks like this:
When it is supposed to look like this:
Steps to Reproduce:
iPhone 6 Plus running iOS 8.0.
An app whose plist supports all-but-portrait-upside-down orientations.
The root view controller of the app is a UITabBarController.
Everything, the tab bar controller and all its descendent child view controllers return UIInterfaceOrientationMaskPortrait
from supportedInterfaceOrientations
.
Start at iOS home screen.
Rotate to landscape orientation (requires iPhone 6 Plus).
Cold-launch the app.
Result: broken interface orientations.
I can't think of any other way to enforce a portrait orientation except to disable landscape altogether, which I can't do: our web browser modal view controllers need landscape.
I even tried subclassing UITabBarController and overriding supportedInterfaceOrientations to return the portrait-only mask, but this (even with all the other steps above) did not fix the issue.
Here's a link to a sample project showing the bug.
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off. Turn your iPhone sideways.
Older iOS Versions – How to Turn Off iPhone 6 Portrait LockStep 1: Swipe up from the bottom of your iPhone screen. Step 2: Tap the circular lock icon at the top-right corner of this gray menu. Portrait orientation lock is turned off when that button is gray.
Choose either landscape (horizontal) or portrait (vertical) orientation for all, or part, of your document. Click PAGE LAYOUT > Orientation. Click Portrait, or Landscape.
I had the same issue when launching our app in landscape on an iPhone 6 Plus.
Our fix was to remove landscape supported interface orientations from the plist via project settings:
and implement application:supportedInterfaceOrientationsForWindow: in the app delegate:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAllButUpsideDown; }
Apparently the information in your plist is to specify what orientations your app is allowed to launch to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With