IOS 启动图像 - 让我发疯

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34112681/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 08:20:50  来源:igfitidea点击:

IOS launch images - driving me crazy

iosxcode

提问by Tom

Apple does not provide a clear list for image file size I should use for:

Apple 没有提供我应该使用的图像文件大小的明确列表:

  • retina hd 5.5 portrait ios 8,9
  • retinia hd 5.5 portrait ios 8,9
  • retinia hd 5.5 landscape ios 8,9
  • iphone portrait ios 2x 7-9
  • iphone portrait ios retina 4 7-9
  • ipad portrait ios 1x 7-9
  • ipad portrait ios 2x 7-9
  • ipad landscape ios 1x 7-9
  • ipad landscape ios 2x 7-9
  • etc.
  • 视网膜高清 5.5 人像 ios 8,9
  • 视网膜高清 5.5 人像 ios 8,9
  • 视网膜高清 5.5 风景 ios 8,9
  • iphone 人像 ios 2x 7-9
  • iphone 人像 ios 视网膜 4 7-9
  • ipad 人像 ios 1x 7-9
  • ipad 人像 ios 2x 7-9
  • ipad 横向 ios 1x 7-9
  • ipad 横向 ios 2x 7-9
  • 等等。

As I intend to use swift I can only suppose ios7+ that means I can ignore all he other sizes for ios5+6. Is that correct?

由于我打算使用 swift,我只能假设 ios7+ 这意味着我可以忽略 ios5+6 的所有其他尺寸。那是对的吗?

(One could also go LaunchScreen.storyboard solution, but that has higher iOS requirements so for now it seems better to include launch images.)

(也可以使用 LaunchScreen.storyboard 解决方案,但它具有更高的 iOS 要求,因此现在最好包含启动图像。)

How to solve the issue of creating all launch images in correct dimensions?

如何解决以正确尺寸创建所有启动图像的问题?

Note to those who put this question on hold:I originally asked if anyone knew of a list with specifications. Apparently that was why you closed the answer 3 years later after I posted it. But in essence this question is and was a programming question regarding Apple API specifications with precise answers possible. It is nota question seeking opinion based answers.

请注意那些搁置这个问题的人:我最初问是否有人知道带有规格的列表。显然,这就是为什么您在我发布答案 3 年后关闭了答案。但本质上,这个问题是一个关于 Apple API 规范的编程问题,可能有精确的答案。这不是一个寻求基于意见的答案的问题。

采纳答案by Thunk

I use a LaunchImage set. Click Images.xcassets from the files list. In the next column to the right, you may need to use the "+" button to add AppIcon and LaunchImages image sets. These will have slots for every supported (expected) screen size. If you use these sets, you don't have to worry about encrypting your image files with Apple's indecipherable naming scheme, you just drag each image file to the corresponding slot in the set.

我使用 LaunchImage 集。从文件列表中单击 Images.xcassets。在右侧的下一列中,您可能需要使用“+”按钮来添加 AppIcon 和 LaunchImages 图像集。这些将为每个支持的(预期的)屏幕尺寸提供插槽。如果您使用这些集合,您就不必担心使用 Apple 难以破译的命名方案加密您的图像文件,您只需将每个图像文件拖到集合中的相应插槽中即可。

Of course, one still has to know the actual dimensions associated with 1x, 2x, retina4, Retina 4.7, Retina 5.5, etc. I'd certainly prefer Xcode to just show the required dimensions of each image, but it doesn't. Barring that, I'd love a single table from Apple listing all the expected dimensions, but that doesn't seem to exist, either. It looks like Apple has, thankfully, consolidated all of this information in the https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/under the "Graphics" section. Specifically, as of this writing for devices supported on IOS10:

当然,人们仍然必须知道与 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

回答by Simo

For anyone finding this now i've created a list to simply explain what each of Apple's somewhat confusing names actually mean.

对于现在发现这个问题的任何人,我创建了一个列表来简单地解释每个 Apple 有点令人困惑的名称的实际含义。



iPhone Portrait iOS 8,9

iPhone 人像 iOS 8,9



iPhone Landscape iOS 8,9

iPhone 横向 iOS 8,9



iPhone Portrait iOS 7-9

iPhone 人像 iOS 7-9



iPhone Portrait iOS 5,6

iPhone 人像 iOS 5,6

回答by skullJ

New Dimensions table for Xcode Version 9.0

Xcode 9.0 版的新尺寸表



iPhone X Portrait iOS 11+

iPhone X 人像 iOS 11+

iPhone X : 1125x2436px

iPhone X:1125x2436px

iPhone X Landscape iOS 11+

iPhone X 横向 iOS 11+

iPhone X : 2436x1125px

iPhone X:2436x1125px



iPhone Portrait iOS 8.9

iPhone 人像 iOS 8.9

Retina HD 5.5 : 1242x2208px
Retina HD 4.7 : 750x1334px

视网膜高清 5.5:1242x2208 像素
视网膜高清 4.7:750x1334 像素

iPhone Landscape iOS 8.9

iPhone 横向 iOS 8.9

Retina HD 5.5 : 2208x1242px

视网膜高清 5.5:2208x1242 像素



iPhone Portrait 7-9

iPhone 人像 7-9

2x : 640x960px
Retina 4 : 640x1136px

2x:640x960px
视网膜 4:640x1136px



iPad Portrait 7-9

iPad 纵向 7-9

1x ; 768x1024px
2x : 1536x2048px

1x ; 768x1024px
2倍:1536x2048px

iPad Landscape iOS 7-9

iPad 横向 iOS 7-9

1x : 1024x768px
2x : 2048x1536px

1x:1024x768px
2x:2048x1536px



iPhone Portrait 5,6

iPhone 人像 5,6

1x : 320x480px
2x : 640x960
Retina 4 : 640x1136px

1x:320x480px
2x:640x960
视网膜 4:640x1136px



iPad Portrait Without Status Bar iOS 5,6

没有状态栏的 iPad 肖像 iOS 5,6

1x : 768x1004px
2x : 1536x2008px

1x:768x1004px
2x:1536x2008px

iPad Portrait 5,6

iPad 人像 5,6

1x : 768x1024px
2x : 1536x2048px

1x
:768x1024px 2x:1536x2048px



iPad Landscape Without Status Bar iOS 5,6

iPad 横向无状态栏 iOS 5,6

1x : 1024x748px
2x : 2048x1496px

1x:1024x748px
2x:2048x1496px

iPad Landscape 5,6

iPad 横向 5,6

1x : 1024x768px
2x : 2048x1536px

1x:1024x768px
2x:2048x1536px

回答by becker

Although not pretty I use this quick way

虽然不漂亮我用这种快速的方式

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  

Do the same for icons and don't look back

对图标做同样的事情,不要回头

回答by KGBird

As with the other answers I use an Asset Catalog and simply drop files into the LaunchImage slots in the Asset Catalog in Xcode. Then I find my app in the Products Group of the Xcode Navigator (tall pane on the left) and Show in Finder. Any copy of your app package will do. Then I Show Package Contents on my app and all the LaunchImage*.png files are there. I just added a portrait launch image for the iPhone X. To see the names and sizes of the immages I navigated to the package in Terminal and ran the file command on the LaunchImage*.png files.

与其他答案一样,我使用资产目录并将文件放入 Xcode 资产目录中的 LaunchImage 插槽中。然后我在 Xcode Navigator(左侧的高窗格)的 Products Group 中找到我的应用程序,并在 Finder 中显示。您的应用程序包的任何副本都可以。然后我在我的应用程序上显示包内容,所有 LaunchImage*.png 文件都在那里。我刚刚为 iPhone X 添加了一个纵向启动图像。要查看图像的名称和大小,我导航到终端中的包并在 LaunchImage*.png 文件上运行 file 命令。

% file LaunchImage*.png
[email protected]:         PNG image data, 1125 x 2436, 8-bit/color RGB, non-interlaced
[email protected]:           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
[email protected]:                PNG image data, 640 x 960, 8-bit/color RGB, non-interlaced
[email protected]:           PNG image data, 750 x 1334, 8-bit/color RGB, non-interlaced
[email protected]:  PNG image data, 1242 x 2208, 8-bit/color RGB, non-interlaced

回答by Guy S

I was dealing with a similar issue to adapt to new iPhone X new screen size and came across this link

我正在处理类似的问题以适应新的 iPhone X 新屏幕尺寸并遇到此链接

It helped me, maybe it will help someone else

它帮助了我,也许它会帮助别人

enter image description here

在此处输入图片说明

回答by user507095

It's so confusing. Can anyone align the sizes along with the names. Is there a link.

这太令人困惑了。任何人都可以将尺寸与名称对齐。有链接吗。

So far I have only this from the other list that seems at all helpful.

到目前为止,我只有其他列表中的这个似乎很有帮助。

The dimensions themselves are helpful only 1/2 way. We need to be able to associate it to the referencing png.

尺寸本身只有 1/2 的帮助。我们需要能够将它与引用 png 相关联。

Here's what I have so far, but it's far from complete. Is there a complete list:

到目前为止,这是我所拥有的,但还远未完成。是否有完整列表:

iPhone Portrait iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 1242px x 2208px - [email protected]
Retina HD 4.7 (iPhone 6) - 750px x 1334px - [email protected]
iPhone Landscape iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 2208px x 1242px - [email protected]
iPhone Portrait iOS 7-9
2x (iPhone 4) - 640px x 960px - [email protected]
Retina 4 (iPhone 5) - 640px x 1136px - [email protected]
iPhone Portrait iOS 5,6
1x (iPhone 3) - 320px x 480px - Default.png
2x (iPhone 4) - 640px x 960px - [email protected]
Retina 4 (iPhone 5) - 640px x 1136px - [email protected]

回答by Azharhussain Shaikh

Launch image for the iPhone Portrait Mode

iPhone 人像模式的启动图像

here you can targetted your desired ios

在这里你可以定位你想要的 ios

iPhone X Portrait iOS 11+(image size 1125 × 2436 pixels)

iPhone X Portrait iOS 11+(图像尺寸 1125 × 2436 像素)

Retina HD 5.5″(image size 1242 × 2208 pixels)

Retina HD 5.5″(图像尺寸 1242 × 2208 像素)

Retina HD 4.7″(image size 750 × 1334 pixels)

Retina HD 4.7″(图像尺寸 750 × 1334 像素)

iPhone Portrait 2x(image size 640 × 960 pixels)

iPhone 人像 2x(图像尺寸 640 × 960 像素)

iPhone Retina 4(image size 640 × 1136 pixels)

iPhone Retina 4(图像尺寸 640 × 1136 像素)

For background images you will need 4 sizes to support the above devices in portrait orientation. They can be stored in whatever folder in your project that you are keeping standard images in. The sizes needed are as follows…

对于背景图像,您需要 4 种尺寸来支持上述设备的纵向。它们可以存储在您保存标准图像的项目中的任何文件夹中。所需的大小如下......

? 640 x 960 (iPhone 4s)

? 640 x 960(iPhone 4s)

? 640 x 1136 (iPhone 5s)

? 640 x 1136 (iPhone 5s)

? 750 x 1334 (iPhone 6)

? 750 x 1334 (iPhone 6)

? 1242 x 2208 (iPhone 6 Plus)

? 1242 x 2208 (iPhone 6 Plus)

? 1125 × 2436 (iPhone X)

? 1125 × 2436 (iPhone X)