react-native - 反应本机模式不向下滑动关闭
问题描述
我正在使用 react-native 的 modal 来显示更大的图像视图:
import { Modal } from 'react-native'
<Modal
animationType="slide"
visible={this.state.modalOpen}
presentationStyle="pageSheet"
swipeDirection='down'
swipeThreshold={50}
onSwipeComplete={()=> this.closeImageModal()}
onDismiss={() => this.closeImageModal()}>
<View style={{ flex: 1, backgroundColor: '#121212', justifyContent: 'center', alignItems: 'center'}}>
<TouchableOpacity
style={{padding: 15}}
onPress = { () => this.closeImageModal() }>
<Ionicons name="ios-close-circle" size={30} color="red" />
</TouchableOpacity>
<Image
source={{ uri: this.state.image }}
style={styles.fullScreenImage}
/>
</View>
</Modal>
现在,我需要按下图像上方的可触摸不透明度来关闭模式。
我尝试过使用react-native-modal
,它在我的应用程序中非常有问题并且难以使用,所以我决定坚持使用 react native 的模态。有什么方法可以实现向下滑动以关闭此模式,而无需使用react-native-modal
?
解决方案
推荐阅读
- powerbi - 功率双日期测量卡
- objective-c - 将属性字符串逐行写入 RTF 文件
- ios - 如何在 Flutter 应用程序中将照片从 iOS 设备上传到 AWS S3?
- javascript - Swagger 授权密钥
- javascript - JavaScript 在控制台中运行良好,但在链接的 .js 文件中运行良好
- python - QuickFIX:意外的午夜序列重置
- arrays - 哈希数组,如何计算具有最独特“页面”视图的“网页”列表?
- node.js - Node / React 应用程序,使用 pkg 为 Linux 打包
- python - 由分组列组成的数据框,然后计算这些组的平均值:如何通过用于分组的列中的变量之一着色?
- kotlin - Klaxon 解析空枚举