Hiding ‘Bottom Navigation Bar’ whilst keyboard is present - Android

浪尽此生 提交于 2019-12-04 22:51:49

The easiest implementation, Add AndroidManifest.xml in

<activity android:windowSoftInputMode="adjustPan"/>

hopefully this helps someone out. Enjoy !

you just add this code in your manifest like this way..

 <activity android:name=".MainActivity"
        android:windowSoftInputMode="adjustPan">

this works for me.. happy coding

I ended up using the height measuring method that seems to be the standard way of soft keyboard detection which is described in this answer. However, I used this library's implementation of it, as it is still the same ViewTreeObserver.OnGlobalLayoutListener method, implemented well, and allowed me to abstract the code out of my applications main codebase.

When this keyboard visibility listener is triggered, I then hide/show the bottom navigation bar (which I have explained here).

In my case, I am using DrawerLayout as a parent view with some layout content and A Navigation Bottom Bar. In Manifest file add "android:windowSoftInputMode="adjustPan" this TAG with Activity and this working fine.

mahesh kumar

Add this line in onResume() of your Activity or Fragment.

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);

It is worked for me. Just try it once.

Add the attribute : android:windowSoftInputMode="adjustResize"" in your manifest inside activity tag:

 <activity
        android:name=".YourActivity"
        android:windowSoftInputMode="adjustResize"/>

NB: I suggest, You should use NestedScrollView as the parent layout.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!