iOS @2x @3x图的区别和理解

本文介绍了iOS应用开发中不同分辨率屏幕所需的图像规格。对于标准分辨率(@1x)、高清(@2x)及更高清(@3x)的显示设备,文章详细解释了如何通过调整像素数量来适配各种屏幕,确保应用图标和图像在所有支持设备上都能清晰呈现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

苹果官方网页介绍:
Icons and Images - Apple Developer

iOS用于在屏幕上放置内容的坐标系统是基于点的度量,点映射到屏幕上的像素。标准分辨率显示器的像素密度为1:1(或@1x),其中一个像素等于一个点。高分辨率显示器有更高的像素密度,提供2.0或3.0的比例因子(称为@2x和@3x)。因此,高分辨率显示器需要更多像素的图像。

例如,假设您有一个标准分辨率(@1x)的图像,它是100px×100px。此图的@2x版本为200px * 200px, @3x版本为300px * 300px。

为您的应用程序中所有的艺术作品提供高分辨率图像,为您的应用程序支持的所有设备。根据设备的不同,可以通过将每个图像中的像素数乘以一个特定的比例因子来实现这一点。

The coordinate system iOS uses to place content onscreen is based on measurements in points, which map to pixels in the display. A standard-resolution display has a 1:1 pixel density (or @1x), where one pixel is equal to one point. High-resolution displays have a higher pixel density, offering a scale factor of 2.0 or 3.0 (referred to as @2x and @3x). As a result, high-resolution displays demand images with more pixels.

For example, suppose you have a standard resolution (@1x) image that’s 100px × 100px. The @2x version of this image would be 200px × 200px, and the @3x version would be 300px × 300px.

Supply high-resolution images for all artwork in your app, for all devices your app supports. Depending on the device, you accomplish this by multiplying the number of pixels in each image by a specific scale factor.

其他参考博客:
iOS @2x @3x图的区别和理解

iOS 图片 @2x与@3x区别

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值