24jieqi / react-native-xiaoshu

🌈 React Native UI library
https://24jieqi.github.io/react-native-xiaoshu
Apache License 2.0
188 stars 21 forks source link

多个Popup叠加展示时怎么保证先后顺序? #50

Closed hu382337381 closed 4 months ago

hu382337381 commented 5 months ago

我现在有两个Popup(A,B)要展示,要求是A和B叠加时B要在上面,之前Android模拟器上是正确的,后来模拟器出问题了,重新创建了模拟器后,同样的代码,先展示A,然后让B再visible=true,结果B却在A的下面

onlyling commented 5 months ago

按理说 Popup 的 zIndex 值每次打开的时候都会 +1代码,如果给 Popup 自定义了样式,且指定了 zIndex 就会覆盖默认累加值,代码

最直接的方式是给 A、B 两个 Popup 添加 style,按照需要的层级手动控制。