Nik*_*nov 23 background-image ios
大多数iOS应用程序都有一个以图像为背景的视图.那里有图像尺寸指南吗?例如,这是在Sketch中设计的iOS屏幕:
如您所见,有一个背景图像.现在每个应用程序都应该支持许多Apple设备.新的iOS 10支持从iPhone 5到iPhone 6s Plus的所有设备.它们具有不同的屏幕尺寸和分辨率.在创建Xcode资产时,我给出了3个不同大小的背景图像 - @1x, @2x, @3x.它们的尺寸应该是多少?
Oha*_*adM 26
我看到它的方式你有2个选择:
if iphone5c { setImage("iphone5cImage") }等等..此外,不要忘记检查此线程:如何在所有可用的iPhone分辨率上处理图像比例?.它将为您提供您正在处理的具体线索.TL; DR,这是我写的选项.
ser*_*eng 14
您只需要提供的背景图像是@ 2x和@ 3x,因为@ 1x设备现在已经在历史的尘封页面中消失了.
说到@ 2x和@ 3x,你给开发者的图像分辨率应该与使用给定大小的最高分辨率的iPhone相同.
为
@2x,这是iPhone 6,它是750x1334和用于@3x,在iPhone 6+是1242x2208.
缩小应该不是问题,因为支持iOS 10的所有iPhone的宽高比是相同的(16:9).
开发人员注意事项:
The UIImageView will then down-scale the images appropriately,
provided:
1. you created an image set with the provided @2x and @3x images,
2. correctly constrainted the UIImageView to the edges of the superview, and
3. selected the Content Mode of the UIImageView as Scale to Fill or Aspect Fill.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22938 次 |
| 最近记录: |