react-native 中 android 和 iOS 的图像大小 [英] Image sizes for android and iOS in react-native

查看:44
本文介绍了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.pngcheck@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.

这篇关于react-native 中 android 和 iOS 的图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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