xcode iOS8 中 iPhone 应用程序启动图像的大小和命名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26754992/
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
Sizes and Naming of Launch Image for iPhone app in iOS8
提问by samir85
What are sizes/namingof the launch imagesused for iPhone app in iOS?
什么是大小/命名的的发射图像用于iPhone应用程序的iOS?
回答by samir85
Size Conventions
尺寸约定
iPhone3g : 320 x 480
iPhone3g:320 x 480
iPhone4/4s : 640 x 960
iPhone4/4s:640 x 960
iPhone5/5s : 640 x 1136
iPhone5/5s:640 x 1136
iPhone6 : 750 x 1334
iPhone6:750 x 1334
iPhone 6plus : 1242 x 2208
iPhone 6plus:1242 x 2208
Naming Conventions
命名约定
For developers who don't wan't to use 'Asset Catalogs', they need to give specific names to launch images
对于不想使用“资产目录”的开发人员,他们需要提供特定名称以启动图像
iPhone3g : 'Default.png'
iPhone3g : 'Default.png'
iPhone4/4s : '[email protected]'
iPhone4/4s : '默认@2x.png'
iPhone5/5s : '[email protected]'
iPhone5/5s:'默认[email protected]'
iPhone6 : '[email protected]'
iPhone6:'默认[email protected]'
iPhone6plus : '[email protected]'
iPhone6plus:'默认[email protected]'
For developers who would use 'Asset Catalogs', they don't need to give specific names to launch images
对于将使用“资产目录”的开发人员,他们无需提供特定名称即可启动图像
Go to ProjectSetting -> General-> Under 'App Icons and Launch Images', select 'Use Asset Catalog'for 'Launch Image Source', and drag-drop the launch images for their OS version's/Orientations
转到ProjectSetting -> General-> 在“App Icons and Launch Images”下,为“Launch Image Source”选择“Use Asset Catalog”,然后拖放其操作系统版本/方向的启动图像
回答by Tapas Pal
If you use images.xcassetsthen you neither need to worry about the naming conventions nor to add those images into your project resource explicitly. Just drag and drop the appropriate size image to the appropriate box and XCode will do the rest.
如果您使用images.xcassets,那么您既不需要担心命名约定,也不需要明确地将这些图像添加到您的项目资源中。只需将适当大小的图像拖放到适当的框中,其余的工作将由 XCode 完成。
And for image sizes please refers the Apple iOS Human Interface Guidelines
对于图像大小,请参阅Apple iOS 人机界面指南
回答by Nagarjun
For iPhone 6:
对于 iPhone 6:
- 750 x 1334 (@2x) for portrait
- 纵向 750 x 1334 (@2x)
- 1334 x 750 (@2x) for landscape
- 1334 x 750 (@2x) 横向
For iPhone 6 Plus:
对于 iPhone 6 Plus:
- 1242 x 2208 (@3x) for portrait
- 纵向 1242 x 2208 (@3x)
- 2208 x 1242 (@3x) for landscape
- 2208 x 1242 (@3x) 横向
回答by Ashley Mills
As an alternative, you could consider using a using a launch storyboard or xib instead. Doing it this way only requires one that adapts to all sizes.
作为替代方案,您可以考虑使用启动故事板或 xib 来代替。这样做只需要一种适应所有尺寸的方法。
Note, this is works for iOS 8 only. If you use this in an app that also targets iOS 7, it will use the standard launch images when running on iOS 7 devices - but of course you only need 3.5 & 4 inch as the new larger iPhones don't support iOS 7!
请注意,这仅适用于 iOS 8。如果您在同样针对 iOS 7 的应用程序中使用它,它在 iOS 7 设备上运行时将使用标准启动图像 - 但当然您只需要 3.5 和 4 英寸,因为新的更大的 iPhone 不支持 iOS 7!
See the Apple docsfor more details.
有关更多详细信息,请参阅Apple 文档。