【问题标题】:Any close event of react-native modal when sliding down向下滑动时任何 react-native modal 的关闭事件
【发布时间】:2020-01-07 08:27:58
【问题描述】:

关闭 react-native 模态时是否有任何事件将其向下滑动而不使用模态内的任何按钮(onDismiss 不起作用)? 谈这个模态https://facebook.github.io/react-native/docs/modal.html

【问题讨论】:

    标签: react-native modal-dialog


    【解决方案1】:

    显然这是一个错误,可能会在下一个版本中修复。

    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});
        });
      };
    

    【讨论】:

      猜你喜欢
      • 2019-06-26
      • 2021-02-18
      • 2018-06-14
      • 2018-07-06
      • 1970-01-01
      • 2020-03-20
      • 2021-03-23
      • 1970-01-01
      • 2021-02-08
      相关资源
      最近更新 更多