为什么iPhone 6使用@ 2x图像资产? [英] Why does iPhone 6 use @2x image assets?
问题描述
iPhone 6 plus 使用 @ 3x 图片资源,但 iPhone 6 使用 @ 2x 图片资源 - 只是喜欢 iPhone 4 和 iPhone 5 (新iPhone 6和6+的图像分辨率,添加了@ 3x支持?。
iPhone 6 plus uses @3x image assets, but iPhone 6 uses @2x image assets - just like iPhone 4 and iPhone 5 (Image resolution for new iPhone 6 and 6+, @3x support added?).
iPhone 5 , iPhone 5C 和 iPhone 5S 的屏幕分辨率 640x1136 。 iPhone 6 的屏幕分辨率 750x1334 。
iPhone 5, iPhone 5C and iPhone 5S have the screen resolution 640x1136. The screen resolution of iPhone 6 is 750x1334.
所以 iPhone 6 将会扩展来自 640x1136 的图片?有没有办法为 iPhone 6 的屏幕分辨率稍微定制图形?
So iPhone 6 will scale up images from 640x1136? Is there any way to make graphics customised for iPhone 6's slightly higher screen resolution?
编辑:
我知道PPI是一样的。但是比如说我希望iPhone 5和iPhone 6上的图像占用所有可用宽度。我创建一个640x200像素的图像,并将其命名为my_image@2x.png。在iPhone 6上,它将被放大到750像素宽,没有?
I know that the PPI is the same. But say for example I want to have an image take up all available width on both iPhone 5 and iPhone 6. I create a 640x200 px image and name it my_image@2x.png. On the iPhone 6 it's going to be upscaled to 750 pixels width, no?
推荐答案
iPhone 6使用@ 2x图像资源而不是R4或其他因为苹果没有为背景图像提供合适的API!
iPhone 6 uses @2x image assets and not R4 or something else because apple didn't provide suitable APIs for background images!
现在最直接的方法是创建2个资产并以编程方式加载它们:(
The most direct way now is to create 2 assets and programatically load them :(
检查出来:如何指定iPhone 6/7自定义边对边图像的大小?
这篇关于为什么iPhone 6使用@ 2x图像资产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!