2

When the TextInput is focus the keybord is hiding the submit buttom. How to auto-slide the components below the TextInput

Karthick Kumar
  • 1,217
  • 1
  • 25
  • 38

2 Answers2

5

How about go now with react-native KeyboardAvoidingView (official docs)

import {KeyboardAvoidingView} from 'react-native';

<KeyboardAvoidingView style={styles.container} behavior="padding" enabled>
  ... your UI ...
</KeyboardAvoidingView>;

Tested on iOS, for me works fine out of the box. For android consider adding parameter: android:windowSoftInputMode="adjustResize" to your AndroidManifest.xml

deevee
  • 1,550
  • 15
  • 21
0

I had the same problem, wanting to move content when the keyboard appears.

I solved it by using the last answer of a similar question:

How to auto-slide the window out from behind keyboard when TextInput has focus?

You basically use event listeners for the keyboard and adjust the content accordingly. Note however that the listeners differ between iOS and Android. Android only supports keyboardDidShow and keyboardDidHide while iOS also supports keyboardWillShow and keyboardWillHide.

Hope it helps!

Community
  • 1
  • 1
pinewood
  • 1,779
  • 1
  • 10
  • 10