2016-11-27 87 views

回答

3

您可以在文件夹中添加图像的大小不同。它与ios实现类似。

└── img 
    ├── [email protected] 
    └── [email protected] 

用法

<Image source={require('./img/check.png')} /> 

打包将捆绑并且用于对应于所述设备的屏幕密度的图像,例如

您最好阅读本页以便更好地理解。 https://facebook.github.io/react-native/docs/images.html

+0

它的工作原理,非常感谢。通过阅读页面,还有另一种方法可以通过在Android中的可绘制文件夹中使用uri指向xxx以及在iOS中使用xxx资源中的xxx。例如,其中voice-run.png位于drawable-xdpi,drawable-xxdpi和[email protected] [email protected]位于iOS的images.xcassets中 – gonglong