Image sizes for android and iOS in react-native

安稳与你 提交于 2019-12-23 07:57:28

问题


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

I have started working on react-native and came across the image issue.

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?

Thanks.


回答1:


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.

Quoting:

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.



来源:https://stackoverflow.com/questions/42282252/image-sizes-for-android-and-ios-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!