React Native KeyboardAvoidingView not working properly

前端 未结 2 1617
一生所求
一生所求 2021-01-07 01:50

I am trying to use the KeyboardAvoidingView with behavior=\"padding\".

When I am trying to enter any text in TextInput, the TextInput field is not moving up. I have

相关标签:
2条回答
  • 2021-01-07 02:24

    I used KeyboardAvoidingView, it also doesn't work. I found this solution, You can take the base code.

    Installation

    npm i react-native-keyboard-aware-scroll-view --save
    

    Usage

    import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
    
    <KeyboardAwareScrollView>
      <View>
        <TextInput />
      </View>
    </KeyboardAwareScrollView>
    

    You can find it here

    0 讨论(0)
  • 2021-01-07 02:39
    <KeyboardAvoidingView
      style={styles.mainContainer}
      behavior="padding"
      enabled
    >
      <View>.......................</View>
    </KeyboardAvoidingView>
    

    'Enabled or disabled KeyboardAvoidingView' should be add.

    0 讨论(0)
提交回复
热议问题