【问题标题】:Web Image not displaying React-NativeWeb 图像不显示 React-Native
【发布时间】:2020-07-06 18:09:06
【问题描述】:

我试图在 React Native 的文本框 (TextInput) 中粘贴一个链接,但它没有显示链接中的图像。我不确定我的错误在哪里。请有人帮助我,我真的很感激。提前谢谢!!!!!!!!!

这是代码

const tryImage = "https://images.app.goo.gl/heFUyytHySGiSMeY8"
<View style={styles.info}>
    <Image source={one} style={styles.progress}/>
    <Text style={styles.title}>Add Photo</Text>
    <Image source={{uri: tryImage}} style={styles.icon}/>
</View>

icon:{
    width: 180,
    height: 180,
    marginTop: 50,
},

【问题讨论】:

    标签: javascript reactjs react-native react-native-elements react-native-image


    【解决方案1】:

    抱歉耽搁了。 可能你的链接有问题。 所以你需要传递正确的uri。 例如,现在您的链接没有任何扩展名,例如 png 或 jpg。 所以请尝试使用png。 例如:source={{uri:tryImage+'png'}} 希望我的回答对你有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-09
      • 1970-01-01
      • 2023-01-31
      • 2021-01-05
      • 1970-01-01
      相关资源
      最近更新 更多