react-native-keyboard-spacer
react-native-keyboard-spacer copied to clipboard
Android nougat readjusts the view based on keyboard
THe library works perfectly find except on Android nougat. On android nugget when the keyboards opened then react native readjusts the view accordingly instead of having the view blocked by the keyboard.
So the library adds an additional keyboard space on top the keyboard as below:
Is there anyway to fix this?
use only for ios
Really? It works on old android versions though!
android does not need this!
- set your reactActivity android:windowSoftInputMode="adjustResize"
2.set your TextInput view style position:'absolute' bottom:0
Thanks @kimlet for the solution;
Going to add a note to the README so future users don't have to deal with this.
hi @kimlet . i was looking for keyboard push the content. but i couldent understand your solition sorry. where will i write your solition ( android:windowSoftInputMode="adjustResize" )... i made my app via crna by the way. thanks.
Thank you for this extremely useful library. @Andr3wHur5t I changed my code to:
{ Platform.OS === "ios" && <KeyboardSpacer /> }
But how do I know if the android version running needs the keyboardspace or not?
we can close this
@sibelius your answer "use only for ios" makes sense but how to detect the running version of android needs to run this as well? 🤔
android solves this itself
just use this
android:windowSoftInputMode="adjustResize"
on AndroidManifest
AndroidManifest fix works in general for Android, but not when you have a WebView with inputs. Then the KeyboardSpacer can be used, but I'm finding that whereas on some Android models it's necessary to use KeyboardSpacer to avoid the input being hidden behind the keyboard, on others using it can show extra white space above the keyboard. I've not tied down why there's a difference yet.