Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native KeyboardAvoidingView not working on ios

$
0
0

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.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>