将图像放在图像顶部React Native

时间:2017-07-22 22:18:32

标签: react-native

我的组件中有一个图像,我正在尝试将图像置于其上。但只有第一张图片显示,我试图放在它上面的那张图片并没有。

2 个答案:

答案 0 :(得分:1)

React Native支持zIndex。您可以为第二个图像添加类似此{ zIndex: 1, position: 'absolute', ... // other position style }的样式,以将其置于其他视图之上。 请参阅https://facebook.github.io/react-native/docs/layout-props.html#zindex以供参考。

答案 1 :(得分:0)

second Image放在first one

<View style={Styles.container}>
    <View style={Styles.viewStyle}>
        <Image
            style={Styles.imageStyle}
            source={require('./Bakgrundsbild.png')} >
            <View style={Styles.logoViewStyle}>
                <Image
                    style={Styles.logoStyle}
                    source={require('./Logo.png')}
                    />
            </View>
         </Image>
     </View>
</View>
相关问题