Why doesn't android:windowSoftInputMode=“stateVisible|adjustResize” adjust the screen when soft keyboard is shown?

后端 未结 5 1856
情书的邮戳
情书的邮戳 2021-01-03 03:02

I can\'t seem to make the android:windowSoftInputMode=\"stateVisible|adjustResize\" option work. When the soft keyboard shows, the scroll view doesn\'t automatically scroll

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 03:40

    Solution: Finally, I found a suggestion that works. I created an OnGlobalLayoutListener() and added it to my scroll view. I checked if the height of the root view of my activity(which is my scroll view) changed. If yes, I'm assuming that the soft keyboard is shown.

    Click here for more info.

提交回复
热议问题