使用KeyboardAvoidingView作为父对象来响应本机ViewPager不会使键盘保持打开状态-iOS

时间:2019-10-17 20:30:37

标签: javascript react-native react-native-ios

当我将ViewPager中的react-native-community/viewpagerKeyboardAvoidingView一起使用时,ViewPager的样式为flex:1,而KeyboardAvoidingView的行为为{{1} }键盘跟不上。

padding

_renderBottomControls()

<KeyboardAvoidingView style={{flex: 1}} behavior="padding">
    <ViewPager
      {...viewPagerProps}
      ref={viewPagerRef}
      scrollEnabled={false}
      keyboardDismissMode="on-drag"
      style={[{flex: 1, borderWidth: 1, borderColor: 'red'}, style]}
      onPageScroll={Animated.forkEvent(onPageScroll, _onPageScroll)}
    />
    {_renderBottomControls()}
  </KeyboardAvoidingView>

GIF showing de issue

0 个答案:

没有答案