1
Android中的drawable-xdpi drawabale-xxdpi和iOS中的@ 2x @ 3x之类的东西?根据dpi反应原生支持加载图像
这里是样品
<Image
source={require('./img/3.jpg')}
resizeMode='cover'/>
Android中的drawable-xdpi drawabale-xxdpi和iOS中的@ 2x @ 3x之类的东西?根据dpi反应原生支持加载图像
这里是样品
<Image
source={require('./img/3.jpg')}
resizeMode='cover'/>
您可以在文件夹中添加图像的大小不同。它与ios实现类似。
└── img
├── [email protected]
└── [email protected]
用法
<Image source={require('./img/check.png')} />
打包将捆绑并且用于对应于所述设备的屏幕密度的图像,例如
您最好阅读本页以便更好地理解。 https://facebook.github.io/react-native/docs/images.html
它的工作原理,非常感谢。通过阅读页面,还有另一种方法可以通过在Android中的可绘制文件夹中使用uri指向xxx以及在iOS中使用xxx资源中的xxx。例如, 其中voice-run.png位于drawable-xdpi,drawable-xxdpi和[email protected] [email protected]位于iOS的images.xcassets中 –
gonglong