React Native - Disable soft keyboard permanently on Android -
is possible not show soft keyboard when textinput gets focused? use case need hide keyboard (for example when use external keyboard) need retain focus on textinput can use (see caret , so).
i don't hacking libs, looked inside textinput
folder in react-native package , found files thought relevant. first one:
i replaced code on line 96 this:
edittext.setinputtype(inputtype.type_null); edittext.settextisselectable(true);
but unfortunately didn't work.
then found file:
and commented out line 215, again, didn't help.
could point me in correct direction how done? thanks.
you can setting flag on mainactivity
in /android
part of project.
open androidmanifest.xml
file app/src/main
, under mainactivity
change:
<activity android:name=".mainactivity" android:label="@string/app_name" android:configchanges="keyboard|keyboardhidden|orientation|screensize" android:windowsoftinputmode="adjustresize">
to this
<activity android:name=".mainactivity" android:label="@string/app_name" android:configchanges="keyboard|keyboardhidden|orientation|screensize" android:windowsoftinputmode="statehidden">
that should disable keyboard permanently activity, in general case bulk of react native app on android. more information see: https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
Comments
Post a Comment