How to keep background image size when software keyboard show

后端 未结 9 1737
一生所求
一生所求 2020-12-08 20:17

When the software keyboard shows, it resizes my layout and thus squeezes the background image together. My question is basically a duplicate of this question, which is expla

9条回答
  •  感动是毒
    2020-12-08 21:06

    I actually ran into a similar problem not too long ago. I stumbled upon the correct answer with a bit of work, though.

    In your android manifest for this project, attached to the specific activity that you are using, use the line android:windowSoftInputMode="adjustPan|stateVisible" in the activity tag.

    adjustPan basically means that your activity will not resize itself to fit the soft keyboard, and stateVisible means that the soft keyboard will show when requested (this can be stateAlwaysVisible, etc if necessary)

    source : Android Dev for Activity tags

提交回复
热议问题