Landscape Launch Images on Xcode 7 madness

ε祈祈猫儿з 提交于 2019-12-11 11:57:20

问题


The application only works on landscape mode. Since iOS 9 release is imminent we're preparing our app to support the latest and greatest.

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!

I've also used the UILaunchImages key in the plist and another weird this is happening!

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?


FIX

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!


回答1:


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!



来源:https://stackoverflow.com/questions/32352236/landscape-launch-images-on-xcode-7-madness

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!