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