I have an image, when I want to make it bigger using resizeMode="cover", part of the image is cut off. How to fix that?
render() {
return (
<View style={styles.container}>
<Image
style={styles.imgStyleGoogle}
source={{uri: 'my.png'}}
/>
<View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
marginLeft: ratio * 5,
marginRight: ratio * 5,
},
imgStyleGoogle: {
flex: 1,
height: ratio*25,
width: ratio*100,
resizeMode:'cover',
}
})
Here is example of the picture:
I found the solution, the problem was with flex: 1
in Image, I deleted it from imgStyleGoogle
and changed resizeMode:'contain'
, and there is no more image cut off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With