我的Android操作系统为5.1,react-natvie为0.50.1,我根据官方网站教程将其设置
<View style={styles.container}>
<Image style={{width:300, height:300}}
source={{url: 'https://example.com/image.jpg'}} />
<Text>hello world</Text>
</View>
它只是显示Hello World
将其更改为uri
,您使用了url
<Image style={{width:300, height:300}}
source={{uri: 'https://example.com/image.jpg'}} />
-
检查Android清单以查看您是否添加此权限:
android:name =" android.permission.internet"
-
更新您的代码:
<View style={styles.container}>
<Image style={{width:300, height:300}}
source={{uri: 'https://example.com/image.jpg'}} />
<Text>hello world</Text>
</View>
使用uri
代替url
<View style={styles.container}>
<Image style={{width:300, height:300}}
source={{uri: 'https://example.com/image.jpg'}} />
<Text>hello world</Text>