RN版本:0.38【RN】图像不显示时没有设置宽度或高度
只是使用Flex,没有宽度和高度指定的影像风格,但图像不会移动屏幕上显示。这个怎么做。
<View style={styles.container}>
<Image style={styles.image} source={{uri : 'https://www.baidu.com/img/bd_logo1.png'}}>
</Image>
</View>
const styles = StyleSheet.create({
container: {
flex: 1
},
image: {
flex: 1,
resizeMode: 'contain'
},
});
尝试'图像:{挠曲:1,宽度:空,高度:空}'样式。 – zvona