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

后端 未结 28 1191
南笙
南笙 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:59

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

    android:windowSoftInputMode="adjustNothing"
    
    0 讨论(0)
  • 2020-11-22 05:59

    So far the answers didn't help me as I have a button and a textInput field (side by side) below the textView which kept getting hidden by the keyboard, but this has solved my issue:

    android:windowSoftInputMode="adjustResize"
    
    0 讨论(0)
  • 2020-11-22 06:00

    This was the best which worked for me

    android:windowSoftInputMode="adjustNothing"
    

    Try it!

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

    Add following code to the 'activity' of Manifest file.

    android:windowSoftInputMode="adjustResize"
    
    0 讨论(0)
  • 2020-11-22 06:00

    Include in your manifest file under activity which you want to display .But make sure not using Full screen Activity

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

    The activity's main window will not resize to make room for the soft keyboard. Rather, the contents of the window will be automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing.

    android:windowSoftInputMode="adjustPan"
    

    This might be a better solution for what you desired.

    0 讨论(0)
提交回复
热议问题