Softkeyboard阻塞的EditText
问题描述:
我有以下问题:
我有一个活动,使用户发布一些文章评论。当用户点击的EditText
字段中的注释可以发布,在 softkeyboard
最终挡住了文本字段,这样用户不能看到的是什么类型的。我怎样才能确保的EditText
字段总是至少部分,可见?
I have an activity which enables a user to post comments on some article. When the user taps the EditText
field where the comment can be posted, the softkeyboard
ends up blocking the text field such that the user can't see what is being typed. How can I make sure that the EditText
field is always, at least partly, visible?
答
您的活动的内容添加到一个滚动的布局,当视图的EditText获得焦点手动滚动滚动型。
Add the contents of your activity to a scrollable layout and when the EditText view gets focus manually scroll the ScrollView.