I have two elements in the screen. The first one is Scrollview with flex and the other is View with fixed height. When keyboard shows up View element goes up.
How to achieve element does not go up?
Ok, here is the code:
<View style={{flex: 1}}>
<Scrollview style={{flex: 1}}>
<TextInput />
</Scrollview>
<View style={{height: 24}}>
Two buttons here...
</View>
</View>
Here is the screenshot:
Just want that two footer buttons do not go up when keyboard is shown.
You can try following code. It may resolve your issue
<KeyboardAvoidingView
behavior={Platform.OS == "ios" ? "padding" : "height"}
keyboardVerticalOffset={Platform.OS == "ios" ? 0 : 20}
enabled={Platform.OS === "ios" ? true : false}>
<Text>Hello</Text>
<Text>World</Text>
</KeyboardAvoidingView>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With