http://mobileoop.com/how-to-use-auto-layout-in-xcode-6-for-ios-7-and-8-development

  • 1x images are for the original iPhone through the 3GS - 'standard' resolution devices (3.5" screens)

  • 2x images are for the iPhone 4 and 4S (3.5" Retina screens)

  • Retina 4 2x are for the iPhone 5 and 5s (4" Retina screens)

  • 3x images are for the new iPhone 6+ (5.5" super-Retina [3x] screen)


http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html

In 1x place image with resolution 320 x 480. 
In 2x place image with resolution 640 x 960. 
In Retina 4 2x place image with resolution 640 x 1136. 
in 3x place image with resolution 1242 x 2207. 

Images of Retina 4 2x will upscale to resolution 750 x 1334. (750 x 1334是iphone 6用
Images 3x will downscale to resolution 1080 x 1920. (1080 x 1920是iphone6+ 用)

注意:iphone 6 使用的是 @2x的图片

解决办法 


怎么使用 Images.xcassets

iPhone 4S
Screen Size: 3.5 Inches
Resolution: 640 x 960 (Half: 320 x 480)

iPhone 5
Screen Size: 4.0 Inches
Resolution: 640 × 1136 (Half: 320 x 568)

iPhone 5S/5C
Screen Size: 4.0 Inches
Resolution: 640 x 1136 (Half: 320 x 568)

iPhone 6
Screen Size: 4.7 Inches
Resolution: 828 x 1472 (Half: 414 x 736)
Resolution: 750 x 1334 (Half: 375 x 667)

iPhone 6 Plus
Screen Size: 5.5 Inches
Resolution: 906 x 1704 (Half: 453 x 852)
Resolution: 1242 x 2208 (1/3: 414 x 736)
The size of iPhone 6 Plus is @3x scaling. So, it is divided by 3.

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐