@gorhom/bottom-sheet 不按键盘

问题描述 投票:0回答:2

这是我的代码

  const snapPoints = useMemo(() => ['25%', '25%', '60%'], []);
  const {animatedHandleHeight, animatedContentHeight} =
   useBottomSheetDynamicSnapPoints(snapPoints);

     <BottomSheetModal
    ref={bottomSheetModalRef}
    index={1}
    snapPoints={snapPoints}
    enableOverDrag={true}
    keyboardBehavior='extend'
    android_keyboardInputMode='adjustResize'
    handleHeight={animatedHandleHeight}
    contentHeight={animatedContentHeight}>
    <View style={[styles.contentContainer]}>
      
        <BottomSheetTextInput
          style={styles.input}
          onChangeText={val => setValue(val)}
          keyboardType="phone-pad"
        />
      ...
    </View>
  </BottomSheetModal>
)

当聚焦于输入时,它不会推动底部工作表

在清单内我添加了这个

android:windowSoftInputMode="adjustPan|adjustResize"

react-native bottom-sheet
2个回答
0
投票

尝试使用 BottomSheetTextInput 上方的 react-native-keyboard-aware-scroll-view


0
投票
这个问题你解决了吗?如果是的话,怎么办?

© www.soinside.com 2019 - 2024. All rights reserved.