Problem:
I am using KeyboardAvoidingView in ios with behavior="padding"
but it's not working.
My screen has four text input fields, which get hidden by keyboard as it opens.
Code:
Screen:
const Screen = () => {
return (
<SafeAreaView>
<KeyboardAvoidingView behavior="padding">
<TextInput style={styles.input} />
<TextInput style={styles.input} />
<TextInput style={styles.input} />
<TextInput style={styles.input} />
</KeyboardAvoidingView>
</SafeAreaView>
);
};
Text input styling:
input: {
height: 100,
borderWidth: 1,
marginBottom: 60,
borderColor: 'black',
marginHorizontal: 30,
},
Expected behaviour:
KeyboardAvoidView should shift all the text input fields up as soon as keyboard opens up.