0

I'm using ImageBackground from React Native and I'm using a background. I would like to use the size of the background to set the size of the element.

<ImageBackground source={require("../images/Image.png")}>
  <Text>Hello World!</Text>
</ImageBackground>

Thanks!

Franco Petra
  • 688
  • 7
  • 18

1 Answers1

0

Define height of your ImageBackground

<ImageBackground style={{height: 300}} source={require("../images/Image.png")}>
  <Text>Hello World!</Text>
</ImageBackground>
Waheed Akhtar
  • 3,110
  • 1
  • 16
  • 30