我正在使用 React Native Paper 库,并且我有一个模态和对话框,我想对话框出现在模态的前面......有没有办法做到这一点?
如果没有办法,我将不得不使用 Modal 自己编写对话框的结构,我宁愿不这样做......
谢谢
我正在使用 React Native Paper 库,并且我有一个模态和对话框,我想对话框出现在模态的前面......有没有办法做到这一点?
如果没有办法,我将不得不使用 Modal 自己编写对话框的结构,我宁愿不这样做......
谢谢
我有同样的问题,我通过使用react-native-paper
和react-native
的模态来解决它。
react-native
: 0.63.2react-native-paper
: 2.16.0
import {Modal as RNModal} from 'react-native';
import {Modal, Portal} from 'react-native-paper';
return (
<Portal>
<Modal>
<View>
...content for the view
</View>
<RNModal visible={props.visible} transparent={true}>
<Dialog visible={props.visible} onDismiss={props.onDismiss}>
...content for dialog
</Dialog>
<RNModal>
</Modal>
</Portal>
);
RNModal
导致内部对话框始终位于顶部。