问题
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