我正在使用react-native 0.28.0。
我尝试按照此教程在iPhone模拟器上显示图像:React Native入门:使用JavaScript构建iOS应用 | Appcoda
var styles = StyleSheet.create({
image: {
width: 107,
height: 165,
padding: 10
}
}
var imageURI = 'http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api'
然后在render()
函数中,我添加了这个:
<Image style={styles.image} source={{uri:imageURI}} />
已分配图像的空间,但未显示图像。