I want my app to have different launch image when launched in portrait vs portrait upside down vs landscape left vs landscape right. Is that possible?
I'm willing to use any of the following:
To see why this is necessary, quit Camera.app and then launch it in landscape left and orientations. Notice the launch image, specifically that the shutter button is located near the home button in both landscape left and right orientations.
This is possible only if it has separate launch images / storyboards for landscape left and right. If it had only one, the shutter button would appear next to the home button in one orientation and next to the speaker (at the top of the screen) in the other orientation.
Camera.app seems to have four different launch images. How do I have four, as well?
EDIT: Based on the accepted answer, I tried adding the following launch images (without adding anything in Info.plist):
On my iPhone 7 Plus, it works correctly in portrait, landscape left and landscape right. Not when the phone is upside down, in which case the portrait launch image is shown, followed by what looks like a 180-degree rotation when the real UI is shown. To confirm this, I drew a big red rectangle in the middle of the portrait upside down launch image, and I don't see this red rectangle when I run the app, so I can confirm that the portrait upside down launch image file isn't being used at all. Do you know why? Do you see anything else wrong with the filenames?
EDIT 2: I added the following to Info.plist:
<key>UILaunchImages</key>
<array>
<!-- 5.5-inch: -->
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
<key>UILaunchImageOrientation</key>
<string>PortraitUpsideDown</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeLeft</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeRight</string>
</dict>
<!-- 4.7-inch: -->
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
<key>UILaunchImageOrientation</key>
<string>PortraitUpsideDown</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeLeft</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeRight</string>
</dict>
<!-- 4-inch: -->
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
<key>UILaunchImageOrientation</key>
<string>PortraitUpsideDown</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeLeft</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
<key>UILaunchImageOrientation</key>
<string>LandscapeRight</string>
</dict>
<!-- 3.5-inch: -->
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
</dict>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
</dict>
</array>
This made things worse — I see a stretched out portrait launch image being used when the phone is in landscape.
Note that all the UILaunchImageName keys are set to Default, relying on iOS to disambiguate them. I also tried renaming the PNGs to things like Default-portrait-upside-down@3x.png and setting the UILaunchImageName to Default-portrait-upside-down. It made no difference.
I believe you can specify a separate launch image for each orientation. iOS (since version 7.0) supports an Info.plist
key UILaunchImages
. The value is an array of dictionaries. Each dictionary describes one launch image. The dictionary can contain a key UILaunchImageOrientation
, for which the value can be any of the four orientations.
Consult the Information Property List Key Reference for more details.