Reputation: 625
I have an imagebackground that's working but exceeds in height, I don't know how to make it fit to the screen. In fact, it 'cuts' the top of the image.
The original image :
my code :
<ImageBackground
source={require("../../assets/images/background-stats.jpg")}
style={{flex: 1,
width: "100%",
height: "100%",
resizeMode: 'contain',
justifyContent: 'center'
}}
Upvotes: 0
Views: 456
Reputation: 1549
imageStyle={{ resizeMode: 'cover' }}
or
imageStyle={{ resizeMode: 'stretch' }}
Upvotes: 1