来自 (http) 的原生图像在发布到 .apk 后不会出现
react native image from (http) doesn't appear after release to .apk
来自 uri (http) 的反应本机图像可以在调试期间出现,但在发布到 apk 并在 android phone.
上安装后不会出现
<Image
source={{uri: props.img}} //props.img value is 'http://example.jpg'
style={{
flex: 1,
height: undefined,
width: undefined,
resizeMode: 'cover',
borderRadius: 10,
marginTop: 12,
}}
/>
将此添加到 AndroidManifest.xml
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
来自 uri (http) 的反应本机图像可以在调试期间出现,但在发布到 apk 并在 android phone.
上安装后不会出现<Image
source={{uri: props.img}} //props.img value is 'http://example.jpg'
style={{
flex: 1,
height: undefined,
width: undefined,
resizeMode: 'cover',
borderRadius: 10,
marginTop: 12,
}}
/>
将此添加到 AndroidManifest.xml
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>