【问题标题】:react native image from (http) doesn't appear after release to .apk来自(http)的反应本机图像在发布到.apk后不会出现
【发布时间】:2021-10-31 02:09:46
【问题描述】:

react native image from uri (http) 可以在调试过程中出现,但在发布到 apk 并安装到 android 手机后不会出现。

<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,
      }}
/>

【问题讨论】:

    标签: android react-native http react-native-android


    【解决方案1】:

    在 AndroidManifest.xml 中添加这个

    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
    

    【讨论】:

    • 太棒了,非常感谢!
    猜你喜欢
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多