I’m facing a problem with Image, need to fit a big image into a 200*300 View, but I want the whole image to fit into my container, I use resizeMode={‘contain’} but it does not seem good.
render() {
return (
<View style={styles.container}>
<Header />
<View style={{ height: 200, width: 300, backgroundColor: 'red', overflow: 'hidden', borderWidth: 2, borderColor: 'green' }}>
<Image style={{flex:1,width:null,height:null }} resizeMode={'contain'} source={{uri: 'http://134.209.40.60/meApunto/1567655610795_1944474896.png'}}></Image>
</View>
</View>
);
}
This is the remote image → http://134.209.40.60/meApunto/1567655610795_1944474896.png
If I use resizeMode={'contain'}
, it seems to get the expected result but not
If I dont use resizeMode, the image doest not fit into its container