简体   繁体   English

React Native:Modal与根组件重叠

[英]React Native: Modal overlaps a root component

I have such structure of screen: 我有这样的屏幕结构:

import Modal from 'react-native-modal';
...
<View>
  <MessageBar />
  <Modal>
    <modal content is here>
  </Modal>
</View>

MessageBar is a rectangle with styles: {position: absolute, zIndex: 1000} MessageBar是具有以下样式的矩形: {position: absolute, zIndex: 1000}

As a result, MessageBar anyway is overlaped by Modal backdrop. 结果, MessageBar无论如何都被Modal背景覆盖。 I tried all possible combination with position and zIndex for both - Modal and MessageBar . 我尝试了对ModalMessageBar都使用positionzIndex所有可能组合。

Any help is appreciated. 任何帮助表示赞赏。

Thanks 谢谢

如果使用的是Modal,则无论您为组件指定什么zIndex,它都将始终与屏幕上的组件重叠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM