reactjs - React Native:通过向下滑动关闭模态后屏幕冻结问题
问题描述
我在 React Native 中遇到问题,我有一个屏幕,其中有一个待办事项列表和搜索栏,单击任何待办事项它会打开一个模式,其中有关闭按钮和内容。
通过按关闭按钮关闭模式时,它工作正常,但是,当我向下滑动时,我的屏幕冻结了,我无法滚动和选项卡上的待办事项列表项也无法按搜索栏输入。
此外,在向下滑动弹出窗口正在关闭但它没有触发onRequestClose
和onDismiss
反应本机版本
"react": "16.8.6",
"react-native": "0.60.5",
模态代码
creditCardsModalVisibleHandler = (visible) => {
this.setState({creditCardsModalVisible: visible});
}
<Modal
animationType="slide"
transparent={false}
visible={creditCardsModalVisible}
presentationStyle="formSheet"
onDismiss={() => {
console.log('Close handled');
this.creditCardsModalSwipeHandler();
}}
onRequestClose={() => {
console.log('Modal has been closed');
this.creditCardsModalSwipeHandler();
}}
>
<View style={[modal.main]}>
<TouchableOpacity onPress={() => {this.creditCardsModalVisibleHandler(!creditCardsModalVisible);}}>
<View style={[modal.closeButton]}>
<ImageBackground source={modal.closeBackgroundImage} style={[modal.closeButtonImage]}/>
</View>
</TouchableOpacity>
</View>
</Modal>
解决方案
推荐阅读
- ios - 在关闭时将值传递给视图控制器时出错 | 斯威夫特 5
- java - CompletableFuture join() 调用挂起主线程。个人期货永远不会完成
- apache-spark - hadoop spark连接失败
- java - 使用 Spring Boot 从另一个服务调用 Rest Service 以进行课程注册系统
- python-3.x - 如何使用 SparkSQL 按列数据类型将数据框拆分为多个数据框?
- vba - 对 Word VBA 中的 WdPasteOptions 枚举感到困惑
- java - 在spring设计中使用arrayblocking队列作为消费者生产者来处理巨大的文件
- sql - 如何检测 SQL Server 查询中的循环引用 - SQL Server 2017
- google-apps-script - Google Spreadsheet Hide and unhide rows based on cell values
- mysql - 在sql中获取某个数字