xcode 启动所有 iOS 屏幕尺寸的屏幕图像尺寸
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32114162/
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
Launch Screen Image size for all iOS screen sizes
提问by Skywalker
I am trying to create a lunch screen image for my iOS app. But I am not sure whats the right size for it.
我正在尝试为我的 iOS 应用程序创建午餐屏幕图像。但我不确定它的合适尺寸。
According to apple website for iPhone 6 the size should be 750 x 1334 (@2x) for portrait.
根据 iPhone 6 的苹果网站,纵向尺寸应为 750 x 1334 (@2x)。
But my question is, how to create a launch screen image that will fit for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
但我的问题是,如何创建适合所有屏幕尺寸(例如 iPhone 5、5s、6、6 plus、iPad 等)的启动屏幕图像?
Whats the correct way of doing this?
这样做的正确方法是什么?
回答by poojathorat
Go to images.xcassets there you can see launch image sizes.Just Enable iOS version from right side. iPhone Portrait iOS 8:- 1242*2208 (5.5 inch) 750*1334 (4.7 HD)
转到 images.xcassets 那里你可以看到启动图像大小。只需从右侧启用 iOS 版本。iPhone 人像 iOS 8:- 1242*2208 (5.5 英寸) 750*1334 (4.7 HD)
iPhone Landscape iOS 8:-2208*1242 (5.5inch)
iPhone 横向 iOS 8:-2208*1242 (5.5inch)
iphone Portrait iOS 7,8 :- 640*960 (@2x) 640*1136 (Retina)
iphone 人像 iOS 7,8 :- 640*960 (@2x) 640*1136 (Retina)
iPhone Portrait 5,6 :- 320*480 (@x) 640*960 (@2x) 640*1136 (retina4)
iPhone 人像 5,6 :- 320*480 (@x) 640*960 (@2x) 640*1136 (retina4)
回答by MirekE
But my question is, how to create a launch screen image that will fit for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
但我的问题是,如何创建适合所有屏幕尺寸(例如 iPhone 5、5s、6、6 plus、iPad 等)的启动屏幕图像?
That will be very hard to do. The devices have different aspect ratios and the difference in size between say iPhone 5 and iPad Air is pretty big to use one image for all. If you want to use the classical launch screen with a screenshot, resizing one image won't look the same as the user interface on different devices. If you want a launch bitmap imageyou will need to supply all the necessary sizes.
这将很难做到。这些设备具有不同的纵横比,而且 iPhone 5 和 iPad Air 之间的尺寸差异非常大,可以使用一张图像。如果您想使用带有屏幕截图的经典启动屏幕,调整一张图像的大小将与不同设备上的用户界面看起来不同。如果你想要一个启动位图图像,你需要提供所有必要的尺寸。
Whats the correct way of doing this?
这样做的正确方法是什么?
You can create either launch PNG image or launch screen as a storyboard.
您可以创建启动 PNG 图像或启动屏幕作为故事板。
For launch image, your project has an assets catalog. Either use existing or add new iOS launch image. The editor will show you all required sizes.
对于启动图像,您的项目有一个资产目录。使用现有的或添加新的iOS 启动图像。编辑器将显示所有需要的尺寸。
For a storyboard, your application probably already has LaunchScreen.storyboard. You typically won't create specific size or sizes here, but use auto layout that will resize the screen appropriately.
对于故事板,您的应用程序可能已经有 LaunchScreen.storyboard。您通常不会在此处创建特定的大小,而是使用会适当调整屏幕大小的自动布局。