react native的Image组件通过网络地址加载图片的时候,若加载失败iOS有默认图片等属性,但安卓没有;但可以通过其他方式来实现;

 {Platform.OS == 'android'?<Image source={{uri:`${company_cover_uri}`}} style={styles.priceDetail} >
                      <Image style={{zIndex: -1,width:45,height:45}} source={require('../../image/default.jpg')}  />
                    </Image>:
                        <Image style={styles.priceDetail} source={{uri:`${company_cover_uri}`}} defaultSource={require('../../image/default.jpg')}/>}

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-12-21
  • 2022-12-23
  • 2022-02-23
  • 2022-03-03
  • 2021-05-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案