react-native-keyboard-spacer icon indicating copy to clipboard operation
react-native-keyboard-spacer copied to clipboard

Android nougat readjusts the view based on keyboard

Open abeikverdi opened this issue 8 years ago • 10 comments

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?

abeikverdi avatar Jan 11 '17 16:01 abeikverdi

use only for ios

sibelius avatar Jan 11 '17 17:01 sibelius

Really? It works on old android versions though!

abeikverdi avatar Jan 12 '17 05:01 abeikverdi

android does not need this!

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

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

kimlet avatar Jan 23 '17 09:01 kimlet

Thanks @kimlet for the solution;

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

Andr3wHur5t avatar Mar 03 '17 07:03 Andr3wHur5t

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.

escalepion avatar Jul 28 '17 11:07 escalepion

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?

wcandillon avatar Jan 10 '18 19:01 wcandillon

we can close this

sibelius avatar Jan 10 '18 19:01 sibelius

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

wcandillon avatar Jan 10 '18 20:01 wcandillon

android solves this itself

just use this

android:windowSoftInputMode="adjustResize"

on AndroidManifest

sibelius avatar Jan 10 '18 20:01 sibelius

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.

JeremyBradshaw7 avatar Feb 04 '20 10:02 JeremyBradshaw7