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

后端 未结 28 1595
南笙
南笙 2020-11-22 05:10

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

28条回答
  •  时光取名叫无心
    2020-11-22 05:58

    You can try to add this attribute dynamically, by putting the following code in the onCreate method of your activity:

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

    This worked for me, but that:

    android:windowSoftInputMode="adjustPan"
    

    didnt.

提交回复
热议问题