Apple没有提供我应该用于的图像文件大小的清晰列表:
因为我打算使用swift,我只能假设ios7 +这意味着我可以忽略ios5 + 6的所有其他尺寸.那是对的吗?
(也可以使用LaunchScreen.storyboard解决方案,但这有更高的iOS要求,所以现在看起来包括启动图像似乎更好.)
如何解决以正确尺寸创建所有启动图像的问题?
对于那个暂停这个问题的人的注意事项: 我最初询问是否有人知道有规格的清单.显然这就是为什么你在我发布它之后3年后才结束答案的原因.但实质上这个问题是关于Apple API规范的编程问题,可能有精确的答案.这是不求意见为主答案的问题.
Sim*_*imo 162
对于现在发现这一点的人,我已经创建了一个列表来简单解释每个Apple有些令人困惑的名字究竟是什么意思.
小智 39
Xcode版本9.0的新维度表
iPhone X:1125x2436px
iPhone X:2436x1125px
Retina HD 5.5:1242x2208px
Retina HD 4.7:750x1334px
Retina HD 5.5:2208x1242px
2x:640x960px
Retina 4:640x1136px
1x; 768x1024px
2倍:1536x2048px
1x:1024x768px
2x:2048x1536px
1x:320x480px
2x:640x960
Retina 4:640x1136px
1x:768x1004px
2x:1536x2008px
1x
:768x1024px 2x:1536x2048px
1x:1024x748px
2x:2048x1496px
1x:1024x768px
2x:2048x1536px
小智 12
虽然不漂亮,但我使用这种方法
1. Create a new LaunchImage and drop any file onto each box
2. Build it , it will fail or have some warnings
3. Click on the "Show Report navigator" and you'll see the sizes/names for each
4. On your image editor resize the image to the proper sizes/names and overwrite to
the respective file as reported in 3. each file is on
<proj dir>/Assets.xcassets/LaunchImage.launchImage
Run Code Online (Sandbox Code Playgroud)
对图标执行相同操作,不要回头看
Thu*_*unk 10
我使用LaunchImage集.单击文件列表中的Images.xcassets.在右侧的下一列中,您可能需要使用"+"按钮添加AppIcon和LaunchImages图像集.这些将为每个支持的(预期)屏幕大小提供插槽.如果您使用这些集合,则无需担心使用Apple的难以理解的命名方案加密图像文件,只需将每个图像文件拖动到集合中的相应插槽即可.
当然,仍然需要知道与1x,2x,retina4,Retina 4.7,Retina 5.5等相关的实际尺寸.我当然更喜欢Xcode只显示每个图像所需的尺寸,但事实并非如此.除此之外,我喜欢Apple的一张表列出所有预期的尺寸,但这似乎也不存在.谢天谢地,Apple似乎在"图形"部分下的https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/中整合了所有这些信息.具体来说,在撰写IOS10支持的设备时:
Device Portrait size Landscape size
iPhone 6s Plus, iPhone 6 Plus 1080px by 1920px 1920px by 1080px
iPhone 6s, iPhone 6 750px by 1334px 1334px by 750px
iPhone SE 640px by 1136px 1136px by 640px
12.9-inch iPad Pro 2048px by 2732px 2732px by 2048px
9.7-inch iPad Pro, iPad Air 2,
iPad mini 4, iPad mini 2 1536px by 2048px 2048px by 1536px
Run Code Online (Sandbox Code Playgroud)
与其他答案一样,我使用资产目录,只需将文件拖放到Xcode资产目录中的LaunchImage插槽中.然后我在Xcode Navigator的产品组中找到我的应用程序(左侧是高窗格),在Finder中显示.您的应用包的任何副本都可以.然后我在我的应用程序上显示包内容,所有的LaunchImage*.png文件都在那里.我刚刚为iPhone X添加了一个纵向启动图像.要查看我在导航到终端包中的图像的名称和大小,并在LaunchImage*.png文件上运行文件命令.
% file LaunchImage*.png
LaunchImage-1100-2436h@3x.png: PNG image data, 1125 x 2436, 8-bit/color RGB, non-interlaced
LaunchImage-700-568h@2x.png: PNG image data, 640 x 1136, 8-bit/color RGB, non-interlaced
LaunchImage-700-Landscape@2x~ipad.png: PNG image data, 2048 x 1536, 8-bit/color RGB, non-interlaced
LaunchImage-700-Landscape~ipad.png: PNG image data, 1024 x 768, 8-bit/color RGB, non-interlaced
LaunchImage-700-Portrait@2x~ipad.png: PNG image data, 1536 x 2048, 8-bit/color RGB, non-interlaced
LaunchImage-700-Portrait~ipad.png: PNG image data, 768 x 1024, 8-bit/color RGB, non-interlaced
LaunchImage-700@2x.png: PNG image data, 640 x 960, 8-bit/color RGB, non-interlaced
LaunchImage-800-667h@2x.png: PNG image data, 750 x 1334, 8-bit/color RGB, non-interlaced
LaunchImage-800-Portrait-736h@3x.png: PNG image data, 1242 x 2208, 8-bit/color RGB, non-interlaced
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
36501 次 |
最近记录: |