如RN的document(0.60.RC。仅显示相关部分)所述,在RN中用Image
渲染网络图像似乎很简单:
export default class DisplayAnImage extends Component {
render() {
return (
<View>
<Image
style={{width: 50, height: 50}}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
</View>
);
}
}
此https://facebook.github.io/react-native/docs/assets/favicon.png
在浏览器中显示为:
我测试了渲染代码,但没有用:
render() {
return (
<View>
<View>
<Image
style={{width:200, height:200}}
source={{uri:'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
</View>
</View>
);
}
}
屏幕上没有任何显示。 uri
链接已经过测试,可以正常工作和加载。 uri
语法正确。这里缺少什么?