iOS:为所有设备启动图像,包括iPad Pro

use*_*552 14 xcode ios xcasset launchimage

我遵循制作静态启动屏幕图像的指导原则.

在此输入图像描述

然而,然后我将图像作为LaunchImage添加到xcassets中

但是,他们没有按预期填写资产.有警告警告我需要有屏幕尺寸,如2208x1242等.我可以拥有应用程序所需的所有尺寸?

在此输入图像描述

另外,为什么没有iPad Pro发布图像?我该如何添加它?谢谢.

Rob*_*Rob 28

如果将图像拖动到启动图像资产目录中,它将警告您它不是正确的尺寸,并会告诉您尺寸应该是什么.从那以后你可以得出结论:

iPhone Portrait iOS 5,6@1x: 320x480
iPhone Portrait iOS 5,6@2x: 640x960
iPhone Portrait iOS 5,6@Retina 4: 640x1136

iPad Portrait Without Status Bar iOS 5,6@1x: 768x1004
iPad Portrait Without Status Bar iOS 5,6@2x: 1536x2008

iPad Portrait iOS 5,6@1x: 768x1024
iPad Portrait iOS 5,6@2x: 1536x2048

iPad Landscape Without Status Bar iOS 5,6@1x: 1024x748
iPad Landscape Without Status Bar iOS 5,6@2x: 2048x1496

iPad Landscape iOS 5,6@1x: 1024x768
iPad Landscape iOS 5,6@2x: 2048x1536

iPhone Portrait iOS 8,9@Retina HD 5.5: 1242x2208
iPhone Portrait iOS 8,9@Retina HD 4.7: 750x1334

iPhone Landscape iOS 8,9@Retina HD 5.5: 2208x1242

12.9-inch iPad Pro Portrait: 2048x2732
12.9-inch iPad Pro Landscape: 2732x2048

iPhone Portrait iOS 7-9@2x: 640x960
iPhone Portrait iOS 7-9@Retina 4: 640x1136

iPad Portrait iOS 7-9@1x: 768x1024
iPad Portrait iOS 7-9@2x: 1536x2048

iPad Landscape iOS 7-9@1x: 1024x768
iPad Landscape iOS 7-9@2x: 2048x1536

iPhone X Portrait iOS 11+: 1125×2436
iPhone X Landscape iOS 11+: 2436x1125

请注意,它不会给我12"iPad的尺寸,所以我从你的问题中包含的iOS人机界面指南 - 启动屏幕中得到了它.


Aru*_*Das 8

已注释资产维度的更新图像:

LaunchImage资产维度


小智 5

对于阅读本文并放弃为iPad Pro 10.5 英寸、11 英寸和 12.9 英寸添加旧式启动图像的任何人,您可以在使用 XCode 中的 Storyboard 或 Launch Screen 内容的情况下添加它们。

我们这样做的方法是编辑我们的应用程序的 .plist:

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>7.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait</string> //iPad Pro 10.5"
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{768, 1024}</string>
    </dict>
    <dict> 
        <key>UILaunchImageMinimumOSVersion</key>
        <string>12.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-1194h</string> //iPad Pro 11"
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{834, 1194}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>9.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait-iPadPro</string>//iPad Pro 12"
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{1024, 1366}</string>
    </dict>
</array>
Run Code Online (Sandbox Code Playgroud)

(一定要明显删除 //iPad Pro 注释!)

这是文件名:

iPad Pro 10.5": Default-Portrait@2x~ipad

iPad Pro 11": Default-Portrait-1194h@2x.png

iPad Pro 12": Default-Portrait-iPadPro@2x~ipad

在所有 3 个设备上进行了测试,并且可以正常工作。

希望这可以帮助某人!