View moves with soft keyboard, blocking other UI objects

点点圈 提交于 2019-12-20 23:26:41

问题


I've got a container view that I'd like to stay at the bottom of my view at all times that sits below a ScrollView. The ScrollView has a handful of UI objects, one being a EditText object. Currently, when the user taps inside of the EditText object, the android-softkeyboard appears, and brings the container view with it, and blocks some UI objects. How can I get that container view to stay at the bottom of the layout at all times and not move with the keyboard when it appears?

Here's a screenshot - http://d.pr/3LQ2

Here's my layout.xml - http://d.pr/HmXC

Thanks in advance, Cole


回答1:


In manifest add in activity tag:

android:windowSoftInputMode="adjustPan"



回答2:


Try moving your container view inside the scrollview. Your view moves up because the scrollview is seen as "resizable" by Android (since it's scrollable, height doesn't matter) and thus other objects will push it up.

So either

1) Move your container inside your scrollview, or

2) Remove the scrollview wrapper.

Or find some other workaround. : )



来源:https://stackoverflow.com/questions/6111752/view-moves-with-soft-keyboard-blocking-other-ui-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!