0

I need to have a background image that repeats horizontally to fill the parent element and takes up 100% of the height (no-repeat).

I have tried setting the image to 'repeat' and height 100% with no luck. Any suggestions how to do this in react-native?

<ImageBackground
     source={staticImages.background.image}
     imageStyle={{ resizeMode: 'repeat', height: '100%' }}
     style={{ flex: 1, width: undefined, height: undefined }}
 >
   .....Content

<ImageBackground/>
niroice
  • 163
  • 1
  • 14

1 Answers1

2

Take outside resizeMode

<ImageBackground
 source={staticImages.background.image}
 imageStyle={{ flex: 1 }}
 resizeMode='repeat'
 style={{ flex: 1, width: undefined, height: undefined }}
 >
   .....Content

<ImageBackground/>
Idan
  • 3,604
  • 1
  • 28
  • 33