问题描述
该应用程序仅适用于横向模式.由于即将发布iOS 9,我们正在准备我们的应用程序以支持最新和最强大的应用程序.
The application only works on landscape mode. Since iOS 9 release is imminent we're preparing our app to support the latest and greatest.
因此,我已迁移为对LaunchImage使用.xcassets并设置了支持iOS6的所有iPhone/iPad图像.在安装了iOS 9的iPhone 6中运行该应用程序可以很好地显示启动图像,但是在安装有iOS 8的iPhone 6中运行该应用程序时,它只会显示黑屏!
So I've migrated to use .xcassets for the LaunchImages and setup all the images iPhone/iPad supporting back to iOS6. Running the app in an iPhone 6 with iOS 9 installed shows the launch image just fine, but when running the app in an iPhone 6 with iOS 8 it just shows a black screen!
我还使用了plist中的UILaunchImages键,这又发生了另一个奇怪的事情!
I've also used the UILaunchImages key in the plist and another weird this is happening!
将图像大小设置为{667,375},它在iOS9上可以正常工作,但不能在iOS 8上正常工作.现在,如果将其设置为{375,667},它将在iOS 8上显示并在iOS 9上缩小!
Set the image size to {667, 375} and it works fine on iOS9 but not on iOS 8. Now if you set it to {375, 667} it shows on iOS 8 and squashed on iOS 9!
<dict>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageSize</key>
<string>{667, 375}</string>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
</dict>
有任何提示吗?这只是一个错误吗?还是我在这里做错了什么?
Any hints? Is it just a bug? Or am I doing something wrong here?
我最终要做的是在iOS8及以下版本的Info.plist中维护 UILauchImages字典.另外,我还创建了一个用于iOS9兼容性的启动图像故事板,该故事板的图像存储在xcassets中.只要确保在Info.plist的 UILaunchImageSize 键中具有正确的高度/宽度即可!
What I ended up doing was to maintain the UILauchImages dict in the Info.plist for iOS8 and below. Also I created a launch image storyboard for iOS9 compatibility, the image for the storyboard is stored in xcassets. Just be sure to have the correct height/width in the UILaunchImageSize key of the Info.plist!
推荐答案
您尝试使用LaunchScreen.xib
文件吗?对我来说很好.
Did you try to use the LaunchScreen.xib
file? It's working well for me.
这很容易,您只需要添加元素并设置自动布局约束.
It is much easier and you just need to add your elements and set up Autolayout constraints.
在没有每个设备启动图像的情况下,您的应用程序将更轻巧!
You will make your app lighter without the launch images for each device!
这篇关于Xcode 7疯狂下的景观启动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!