react-native 中 android 和 iOS 的图像大小
在制作iOS App时,我们通常会提供@x、@2x、@3x的图片.根据我对android的了解,大约有六种不同的尺寸
While making iOS Apps, we generally used to supply @x,@2x,@3x images. And based on my knowledge in case of android, there was some approx six different sizes
我已经开始研究 react-native 并遇到了图像问题.
I have started working on react-native and came across the image issue.
我的问题是:我是否需要提供所有不同尺寸的图像(即通过结合 iOS 和 android 提供大约 6-7 个图像集)还是只有 1 个图像和其余的将在内部处理?它在更高分辨率的手机上看起来会模糊吗?
My Question are: Do I need to provide images with all different sizes (i.e. approx 6-7 image sets by combining iOS and android) Or only 1 image and rest will be taken care internally? Will it look blurred on higher resolution phones?
谢谢.
您仍然需要提供多个图像.根据 Images 文档,如果您使用名为 check.png
,您还必须包含 check@2x.png
和 check@3x.png
.
You still need to provide multiple images. According to the Images documentation, if you are using an image named check.png
, you also have to include check@2x.png
and check@3x.png
.
引用:
打包器将捆绑并提供与设备对应的图像屏幕密度.例如,check@2x.png,将在 iPhone 上使用7、whilecheck@3x.png 将用于 iPhone 7 Plus 或 Nexus 5.如果没有与屏幕密度匹配的图像,最接近的最佳选项将被选中.
The packager will bundle and serve the image corresponding to device's screen density. For example, check@2x.png, will be used on an iPhone 7, whilecheck@3x.png will be used on an iPhone 7 Plus or a Nexus 5. If there is no image matching the screen density, the closest best option will be selected.