我尝试了很多次,仍然找不到解决方法。
在一个屏幕上,我有很多组件。我将它们分为头部和内容视图组件。
在内容组件中,有地图组件(图像),还有其他组件,例如人物组件(图像)。
在地图组件中,我想要一个透明的全屏叠加层,但它只会覆盖地图组件。在React Native中,没有z-index。我该怎么做?
<View>
<View style={styles.header}>
.....
</View>
<View style={styles.content}>
<Image style={styles.map}>
<View style={styles.overlay}>
<Image style={styles.people} />
<Image style={styles.destination} />
</View>
</Image>
</View>
</View>
就像这个例子一样,无法覆盖整个屏幕: https://rnplay.org/apps/wHCi_A
<Modal transparent=true, visible=true></Modal>
了解更多信息,请查看React Native Modal。 - Ashok R