How do I create launch images for iPhone 6 / 6 Plu

2019-01-02 22:21发布

I've got an existing landscape only app that I'm trying to add iPhone 6 / iPhone 6 Plus support for. When I was supporting iOS 6 / 7 I simply used the default-named launch portrait images with a landscape image rotated into portrait (ie. for 4" screens I created a landscape 1136x640 and then rotated to create a 640×1136 launch image.)

I'm trying to get something working for iOS 8 and iPhone 6 / 6+ and have not come up with something that works yet. Here are some things that I have tried:

  1. Follow the pattern for 4" screen launch image convention. I created Default-667h@2x.png and Default-736h@3x.png images. This did trick the simulator to run at proper iPhone 6/6+ resolution but when launching, the 4" screen launch image is used, not the new ones I created.
  2. Use an Asset Catalog - I create portrait launch images for iPhone 6 and iPhone 6 Plus in a LaunchImages Asset, as well as a Landscape one for iPhone 6 Plus. The iPhone 6 Plus works, but iPhone 6 just shows a black screen. (There's no way to create a iPhone 6 landscape launch image in an asset catalog)
  3. Specify UILaunchImages array in Info.plist with entries for all screen sizes (see reference https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW28). I get similar results to an Asset Catalog here. I can get iPhone 6 Plus landscape working but not iPhone 6 landscape.

11条回答
smile是对你的礼貌
2楼-- · 2019-01-02 23:01

I found a workaround that makes landscape only launch images work on iOS 8 GM. I ended up using the UILaunchImages array in Info.plist. The trick is to get image to show up that doesn't explicitly support landscape (iPhone 4/4S, iPhone 5/5S/5C, iPhone 6) you need to specify duplicate entries. See my example below. This is for a landscape only phone app that supports both orientations for iPad. iOS 7 will fallback to the default image names.

All iPhone launch images need to be rotated into portrait orientation as usual EXCEPT for the iPhone 6 Plus launch image. It natively supports landscape orientation launch images, so you need to leave it's launch image in landscape orientation.

Here are relevant bits of your Info.plist:

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 480}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{320, 480}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 568}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{320, 568}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
</array>
查看更多
地球回转人心会变
3楼-- · 2019-01-02 23:02

For iPhone 6:

750 x 1334 (@2x) for portrait
1334 x 750 (@2x) for landscape

For iPhone 6 Plus:

1242 x 2208 (@3x) for portrait
2208 x 1242 (@3x) for landscape

or you can go through this link it may help you

http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/

查看更多
你好瞎i
4楼-- · 2019-01-02 23:04

What I've done is change my project to NOT use an asset catalog for launch images, and use the old technique for iOS7 and earlier. This gets the launch images working for iOS7 and earlier.

To get them also working for iOS8 so that you can get the correct resolution, and have your app recognised as being built for the new iPhone 6/+, you also need to create a new LaunchImage XIB and tell Xcode to use that.

What appears to happen is that launching the app on an iOS8 device uses the new XIB technique, and launching it on an iOS7 or earlier device uses the images you've grown to know and love.

This for me seems to work. It's ugly IMO, but it works.

Hope this helps some people.

查看更多
Deceive 欺骗
5楼-- · 2019-01-02 23:05

The pattern has changed for the iPhone 6 etc

iPhone 6 (750x1334):

Default-375w-667h@2x~iphone.png

iPhone 6 Plus: (1242x2208)

Default-414w-736h@3x~iphone.png

Default-Landscape@3x.png (For Landscape)

Note if you support iPad then you must rename your iPad Default images to append ~ipad e.g. Default-Portrait~ipad.png to prevent the 6 plus from picking those up because those override the 3x image.

查看更多
Anthone
6楼-- · 2019-01-02 23:06

For all iPhones except the plus, there is no separate launch screen for landscape-only apps. You set the orientation in the plist as Deepak described, and then you set your portrait launch screen to the rotated version of your landscape launch screen.

This is how it's always been, and the only thing that has changed is that the plus now supports a separate, distinct landscape launch screen. All other devices still only support portrait launch screens regardless of your app's starting orientation.

查看更多
登录 后发表回答