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

How to place an Image on top of other Image in React Native?

$
0
0

I placed an Image as a root node in order to make it a background for my View. But it appears that all others image become invisible...Is it any way to place an image on top of the background using built-in components, without any plugins?
In the following code sample landing-background is used as a background, my logo image is visible, but only if background is removed.
Text is showing on top of the background without any concerns...

<View style={styles.container}><Image source = {require('./img/landing-background.jpg')}              resizeMode = 'cover' style = {styles.backdrop}><View style = {styles.overlay}><Text style = {styles.headline}>It should appear in front of the Background Image</Text><Image style = {styles.logo} source = {require('./img/logo.png')} /></View></Image></View>var styles = StyleSheet.create({      container: {        flex: 1,        alignItems: 'center',      },      overlay: {        opacity: 0.5,        backgroundColor: '#000000'      },      logo: {        backgroundColor: 'rgba(0,0,0,0)',        width: 160,        height: 52      },      backdrop: {        flex:1,        flexDirection: 'column'      },      headline: {        fontSize: 18,        textAlign: 'center',        backgroundColor: 'rgba(0,0,0,0)',        color: 'white'      }    });

Viewing all articles
Browse latest Browse all 17111

Trending Articles



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