简体   繁体   English

iOS 背景图片分辨率:如何支持所有 iOS 设备

[英]iOS background image resolution: How to support all iOS devices

We need to set background images that supports all iOS devices including recently launched devices like iPhone 12 and 12 Pro Max.我们需要设置支持所有 iOS 设备的背景图片,包括最近推出的 iPhone 12 和 12 Pro Max 等设备。

Right now we are using following resolutions images for background images.现在我们使用以下分辨率图像作为背景图像。

  • 640x1136 -> @2x 640x1136 -> @2x
  • 750x1334 -> @2x 750x1334 -> @2x
  • 1242x2208 -> @3x 1242x2208 -> @3x
  • 1080x1920 -> @3x 1080x1920 -> @3x

Is there any naming convention that we need to follow to support all the devices?我们是否需要遵循任何命名约定来支持所有设备?

I found apple documentation in which all resolutions are mentioned with specific devices which we can use.我找到了苹果文档,其中提到了我们可以使用的特定设备的所有分辨率。 https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/ https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/

In Assets.xcassets how to set @2x and @3x images because there are multiple @2x and @3x images based on the different screen resolutions.在 Assets.xcassets 中如何设置@2x 和@3x 图像,因为根据不同的屏幕分辨率有多个@2x 和@3x 图像。

Use vector images.使用矢量图像。 Apple does not support SVG so your best option is to use PDF. Apple 不支持 SVG,因此您最好的选择是使用 PDF。 You can then use .aspectFill or any other settings to scale the image to diffrent devices as you see fit.然后,您可以使用 .aspectFill 或任何其他设置将图像缩放到您认为合适的不同设备。

After importing the files into Assets you want to check the "Preserve as Vector" box.将文件导入资产后,您要选中“保留为矢量”框。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM