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

后端 未结 28 1193
南笙
南笙 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 06:08
    android:windowSoftInputMode="stateHidden|adjustNothing"
    

    This code works.

    0 讨论(0)
  • 2020-11-22 06:08
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    

    This one is working for me.

    0 讨论(0)
  • 2020-11-22 06:09

    @manifest in your activity:

    android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
    
    0 讨论(0)
  • 2020-11-22 06:10

    In my case I needed the keyboard to stay hidden and just after the click of the button my layout needs to be adjusted, so I just added this command in the manifest and it got super right.

    android:windowSoftInputMode="stateHidden|adjustResize"
    
    0 讨论(0)
提交回复
热议问题