如何为iPhone 6/6 Plus Landscape Only应用程序创建启动图像? [英] How do I create launch images for iPhone 6 / 6 Plus Landscape Only Apps?

查看:86
本文介绍了如何为iPhone 6/6 Plus Landscape Only应用程序创建启动图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的横向应用程序,我正在尝试添加iPhone 6 / iPhone 6 Plus支持。当我支持iOS 6/7时,我只使用了默认命名的启动肖像图像,并将风景图像旋转为纵向(即,对于4屏幕,我创建了一个横向1136x640,然后旋转以创建640×1136启动图像。)

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.)

我正在尝试为iOS 8和iPhone 6 / 6+工作,并且还没有找到有效的东西。这里有一些我有的东西试过:

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. 按照4屏幕启动图像惯例的模式。我创建了Default-667h@2x.png和Default-736h@3x.png图像。这确实欺骗了模拟器以适当的iPhone 6/6 +分辨率运行,但是在启动时,使用的是4英寸屏幕启动图像,而不是我创建的新图像。

  2. 使用资产目录 - 我在LaunchImages资产中创建了iPhone 6和iPhone 6 Plus的纵向启动图像,以及iPhone 6 Plus的横向图像.iPhone 6 Plus可以工作,但iPhone 6只显示黑屏。(没有办法创建)资产目录中的iPhone 6横向启动图像)

  3. 在Info.plist中指定UILaunchImages数组,其中包含所有屏幕尺寸的条目(请参阅参考 https://developer.apple.com/ library / content / documentation / General / Reference / InfoPlistKeyReference / Articles / iPhoneOSKeys.html#// apple_ref / doc / uid / TP40009252-SW28 。我在这里得到了与资产目录类似的结果。我可以得到iPhone 6 Plus风景有效,但不适用于iPhone 6风景。

  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.


推荐答案

我找到了一个解决方法仅在iOS 8 GM上启动图像。我最终在Info.plist中使用了UILaunchImages数组。诀窍是让图像显示不明确支持横向(iPhone 4 / 4S,iPhone 5 / 5S / 5C,iPhone 6),您需要指定重复的条目。请参阅下面的示例。这适用于仅支持横向iPad的横向手机应用程序。 iOS 7将回退到默认图像名称。

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.

所有iPhone启动图像都需要像往常一样旋转到纵向,除了iPhone 6 Plus启动图像。它原生支持横向启动图像,因此您需要以横向方式保留它的启动图像。

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.

以下是Info.plist的相关位:

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>

这篇关于如何为iPhone 6/6 Plus Landscape Only应用程序创建启动图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆