Android: How do I prevent the soft keyboard from pushing my view up?


Question

I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it to remain at the bottom of the screen, becoming hidden when the keyboard is shown.

Anyone else run into this issue? Know how to fix it?

1
344
11/17/2010 6:38:17 PM

Accepted Answer

You can simply switch your Activity's windowSoftInputModeflag to adjustPan in your AndroidMainfest.xml file inside your activity tag.

Check the official documentation for more info.

<activity
   ...
   android:windowSoftInputMode="adjustPan"> 
</activity>
577
2/27/2019 6:56:13 AM

None of the answers worked for me, but this did the trick:

android:windowSoftInputMode="adjustNothing"

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon