Andr3wHur5t / react-native-keyboard-spacer

Plug and play react-native keyboard spacer view.
MIT License
1.56k stars 219 forks source link

Android nougat readjusts the view based on keyboard #46

Open abeikverdi opened 7 years ago

abeikverdi commented 7 years ago

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:

capture

Is there anyway to fix this?

sibelius commented 7 years ago

use only for ios

abeikverdi commented 7 years ago

Really? It works on old android versions though!

kimlet commented 7 years ago

android does not need this!

  1. set your reactActivity android:windowSoftInputMode="adjustResize"

2.set your TextInput view style position:'absolute' bottom:0

Andr3wHur5t commented 7 years ago

Thanks @kimlet for the solution;

Going to add a note to the README so future users don't have to deal with this.

escalepion commented 7 years ago

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.

wcandillon commented 6 years ago

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?

sibelius commented 6 years ago

we can close this

wcandillon commented 6 years ago

@sibelius your answer "use only for ios" makes sense but how to detect the running version of android needs to run this as well? 🤔

sibelius commented 6 years ago

android solves this itself

just use this

android:windowSoftInputMode="adjustResize"

on AndroidManifest

JeremyBradshaw7 commented 4 years ago

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.