Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29622

ImageBackground repeat on Android not filling up the screen

$
0
0

I am building an app using react native and I want to achieve a background image with repeat resize mode like this.

<View 
            style   = {style.container}>
            <ImageBackground 
                source={require('../../assets/images/background.png')}
                resizeMode="repeat"
                style={style.imageBackground}
                >
                    ...
            </ImageBackground>
        </View>

Styles:

imageBackground: {
    width: '100%', 
    height: '100%', 
    resizeMode: 'repeat',
    justifyContent:'center'
},
container: {
    marginTop: Platform.OS === 'ios' ? 0 : StatusBar.currentHeight + 30,
    flex: 1,
    backgroundColor: COLORS.BACKGROUND,
    justifyContent: 'center',
},

On iOS it works perfectly. But when I open Android it looks like this:

What am I doing wrong?


Viewing all articles
Browse latest Browse all 29622

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>