android - @gorhom/react-native-bottom-sheet 不适用于 Android
问题描述
我一直在使用该库为我的 react native 应用程序创建底部表单模式,但它似乎不适用于 Android,但在 iOS 上却可以。我使用了文档中建议的相同背景组件和手柄组件,并且包含的所有内容都是提供程序,并且 SafeAreaView 我的 package.json 包括
"@gorhom/bottom-sheet": "^3.6.5",
"react-native-reanimated": "^2.0.0",
代码结构如下:
<BottomSheetModal ref={reference_settings}
index = {1}
enableOverDrag={true}
onChange = {(index) => { if(index === 0) { reference_settings.current.dismiss(); } }}
snapPoints = {[-1, '50%', '70%']}
backdropComponent={Backdrop}
handleComponent ={(props) => (<Belt {...props} />)}
style ={styles.sheet}
>
<BottomSheetView style={[styles.content]}>
<View style={{ width, height: '100%', overflow: 'hidden', backgroundColor: scheme === 'dark' ? '#000' : '#FFF', paddingHorizontal: 10 }}>
// the functions inside
</View>
</BottomSheetView>
</BottomSheetModal>
我为包含插件的 react-native-reanimated 使用了正确的 babel 配置,但它显示出来,然后我无法拖动关闭。
解决方案
推荐阅读
- python - 有没有更好的方法仅使用 while 循环在 python 中打印此模式?
- mysql - MySQL表,其中每个“数据”都有不同的数量信息
- java - 如何使用 Java 在 Windows 上的常见(非用户特定)文件位置附加数据文件?
- elasticsearch - 如何在使用 Java API 创建索引时使用模板
- java - SMTP 服务器无法与 Exchange 服务器通信
- javascript - 如何更改 ReactJS 挂钩中的日期格式?
- excel - 登录页面后如何使用 URLDownloadToFile 下载(用户名和密码)
- java - 在java中触发ContentAssistant
- file - Spring集成+文件读取消息源_Inbound Channel Adapter + Outbound Gateway
- stackblitz - 防止在每次按键时重新编译项目