1x vs r4或2x vs r4或3x vs r4有什么区别 [英] What is the difference between 1x vs r4 or 2x vs r4 or 3x vs r4

查看:162
本文介绍了1x vs r4或2x vs r4或3x vs r4有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果1x图像为100 * 100,则

If 1x image is 100*100 then

2x图像为200 * 200

2x image is 200 * 200

3x图像为300 * 300

3x image is 300 * 300

r4的尺寸应为xxx * xxx

what is r4 dimension should be xxx * xxx

没有任何文档.

仅供参考:

这与启动屏幕图像无关...图像可以是诸如后退按钮之类的东西...

Its not about launch screen image ... the image can be anything like back button etc...

推荐答案

答案不是那么简单.
要记住的重要一点是,不同型号的iPhone会自动使用图像集中的不同图像. iPhone-A的分辨率并不总是iPhone-B的简单倍数,因此image-A的大小并不一定总是iPhone-B的简单倍数.

The answer isn't that straight forward.
The important thing to remember is that different iPhone models would automatically use different images from the imageset. The resolution of iPhone-A is not always a simple multiplication of iPhone-B, so the size of image-A can't always be a simple multiplication of image-B.

Here is a table showing the image automatically selected from x.imageset for each iPhone:
         iPhone Model | ScreenSize | Ratio | x.ImageSet
         -------------|------------|-------|----------------
            XS Max    | 1242-2688  | 0.46  | 3x
            X,XS      | 1125-2436  | 0.46  | 3x
            XR        |  828-1792  | 0.46  | 2x
            6,6s,7,8+ | 1242-2208  | 0.56  | 3x
            6,6s,7,8  |  750-1334  | 0.66  | 2x 
            5,5s      |  640-1136  | 0.56  | R4

如表所示,为多个屏幕尺寸和多个宽高比选择了相同的图像,这可能会导致混乱...
那就是显示图像的视图的Content Mode属性派上用场的地方.它决定图像在边界内的伸展方式(LaunchScreen图像边界是屏幕尺寸,后退按钮边界是ImageView尺寸).

As the table shows the same image is selected for multiple screen sizes and multiple aspect ratios, that can lead to a bit of a mess...
Thats where the Content Mode property of the view showing the image comes in handy. It decides how the image will stretch inside its boundaries (LaunchScreen image boundaries are the screen size, Back button boundaries are the ImageView size).

如果Content Mode = Aspect Fill
然后,从图像集中选择的图像将调整其宽度大小,使其与边界宽度完全相同,并且高度也将更改以保持原始图像的宽高比-由于其超出边界或未达到边界,其上边缘和下边缘将被隐藏.边界.

If the Content Mode = Aspect Fill
Then the selected image from the imageset will resize its width to be exactly as the boundary width and the height will also change to maintain the original image aspect ratio - its top and bottom edges will be hidden because they exceeded the boundary or will not reach the boundary at all.

其他Content Modes将对图像产生其他影响. 看看:了解图像的缩放方式

Other Content Modes will have other effects on the image. Take a look: Understanding How Images Are Scaled

这篇关于1x vs r4或2x vs r4或3x vs r4有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆