向下滑动时react-native modal的任何关闭事件
Any close event of react-native modal when sliding down
关闭反应本机模态的任何事件将其向下滑动而不使用模态内的任何按钮(onDismiss 不起作用)?
谈论这个模态 https://facebook.github.io/react-native/docs/modal.html
显然这是一个错误,可能会在下一个版本中修复。
https://github.com/facebook/react-native/issues/26892
到那时为止的解决方法(使用文档中的示例):
setModalVisible = visible => {
// Assuming that the button who's calling this method is behind the modal, before clicking it, first set modal to visible false, then set the state from the button `visible` or not.
this.setState({modalVisible: false});
setTimeout(() => {
this.setState({modalVisible: visible});
});
};
关闭反应本机模态的任何事件将其向下滑动而不使用模态内的任何按钮(onDismiss 不起作用)? 谈论这个模态 https://facebook.github.io/react-native/docs/modal.html
显然这是一个错误,可能会在下一个版本中修复。
https://github.com/facebook/react-native/issues/26892
到那时为止的解决方法(使用文档中的示例):
setModalVisible = visible => {
// Assuming that the button who's calling this method is behind the modal, before clicking it, first set modal to visible false, then set the state from the button `visible` or not.
this.setState({modalVisible: false});
setTimeout(() => {
this.setState({modalVisible: visible});
});
};