【问题标题】:not all images displaying in react native android并非所有图像都显示在本机 android 中
【发布时间】:2019-12-18 06:19:23
【问题描述】:

我正在使用 react native image 组件,我正在从 rest api 获取一个 url 图像。问题是那些图像没有在 android api 16 和 17 中加载和显示,但在 android api 27 genymotion 中显示(在开发和发布中)。

这是在 android 16 和 17 中未显示的图像的 url:

http://flags.fmcdn.net/data/flags/w580/tr.png

这是在 android 16 和 17 中成功加载的图像的 url:

https://image.delfoo.com/data/background/food-pizza.jpg

这是我的代码:

<Image source={{uri:'http://flags.fmcdn.net/data/flags/w580/tr.png'}} style={{width:50,height:50}}/>

当我在 Image 组件和控制台中使用 onError 方法时,它会显示此错误:

SyntheticEvent {dispatchConfig: {…}, _targetInst: FiberNode, _dispatchListeners: ƒ, _dispatchInstances: FiberNode, nativeEvent: {…}, …}

附加信息

React Native 版本:0.59.9

平台:安卓

开发操作系统:Windows

【问题讨论】:

    标签: react-native react-native-android


    【解决方案1】:

    只需在 app/build.gradle 的依赖部分添加以下代码:

    implementation 'org.conscrypt:conscrypt-android:2.1.0'
    

    【讨论】:

    • 在我看来你需要正确地标记你的答案
    猜你喜欢
    • 2017-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多