Dealing with iPhone 6/6+ startup images

只谈情不闲聊 提交于 2019-12-04 09:46:44

You can name them whatever you want, you just have to make sure they are in your plist, and that you don't specify the extension or @2x or @3x suffix in the plist. The files in your Xcode project should have the .png and @2x or @3x extension. The size is always specified in portrait mode (even for landscape images).

This has the added benefit of not using the asset catalog and allowing you to easily load the png in your app to do a custom transition from the splash screen to your app.

Here's an example from my app, You Doodle:

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>7.0</string>
        <key>UILaunchImageOrientation</key><string>Portrait</string>
        <key>UILaunchImageSize</key><string>{320, 480}</string>
        <key>UILaunchImageName</key><string>Default</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>7.0</string>
        <key>UILaunchImageOrientation</key><string>Portrait</string>
        <key>UILaunchImageSize</key><string>{320, 568}</string>
        <key>UILaunchImageName</key><string>Default-568h</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>7.0</string>
        <key>UILaunchImageOrientation</key><string>Landscape</string>
        <key>UILaunchImageSize</key><string>{768, 1024}</string>
        <key>UILaunchImageName</key><string>Default-Landscape</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>7.0</string>
        <key>UILaunchImageOrientation</key><string>Portrait</string>
        <key>UILaunchImageSize</key><string>{768, 1024}</string>
        <key>UILaunchImageName</key><string>Default-Portrait</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>8.0</string>
        <key>UILaunchImageOrientation</key><string>Landscape</string>
        <key>UILaunchImageSize</key><string>{414, 736}</string>
        <key>UILaunchImageName</key><string>Default-Landscape-736h</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>8.0</string>
        <key>UILaunchImageOrientation</key><string>Portrait</string>
        <key>UILaunchImageSize</key><string>{414, 736}</string>
        <key>UILaunchImageName</key><string>Default-Portrait-736h</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key><string>8.0</string>
        <key>UILaunchImageOrientation</key><string>Portrait</string>
        <key>UILaunchImageSize</key><string>{375, 667}</string>
        <key>UILaunchImageName</key><string>Default-Portrait-667h</string>
    </dict>
</array>

Details are already there, you just need to check the attribute inspector.

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