我一直在使用这个库为我的react原生应用程序创建底层模态,但它似乎在安卓上不起作用,但在iOS上却可以。我使用了文档中建议的相同的背景组件和句柄组件,所有内容都是provider,SafeAreaView my 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使用了正确的配置,但是它显示了,然后我就不能拖动关闭了。
发布于 2021-11-16 09:29:14
我知道现在回答你有点晚了,但我想补充给其他人。假设您已经安装了react-native-gesture-handler,您还应该在MainActivity.java中添加一些代码行。

https://stackoverflow.com/questions/67687631
复制相似问题