I have a background image and i want to set the height and width to 100%. What is the best way to proceed in ReactXP.
Asked
Active
Viewed 52 times
1 Answers
0
Try this
<View style={{ width: 200, height: 300, backgroundColor: "red" }}>
<Image
source="https://via.placeholder.com/150"
style={{ width: "100%", height: "100%" }}
resizeMode="cover"
/>
</View>
Only tested on the Web. If it's not working on React Native, you'd have to measure the wrapping View with onLayout
to get its width and height.

Frexuz
- 4,732
- 2
- 37
- 54