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

查看:21
本文介绍了如何为 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天全站免登陆