简体   繁体   English

软键盘阻止EditText

[英]Softkeyboard blocking EditText

I'm having the following problem: 我遇到以下问题:

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. 当用户点击可在其中张贴评论的EditText字段时, softkeyboard最终将阻止该文本字段,从而使用户看不到正在键入的内容。 How can I make sure that the EditText field is always, at least partly, visible? 如何确保EditText字段始终(至少部分是可见)?

将活动的内容添加到可滚动的布局中,然后在EditText视图获得焦点时手动滚动ScrollView。

使用scrollview使布局可滚动,以便Edittext可以向上滚动并放置在软键盘上方,并且您可以查看EditText。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM