如何在焦点对准时使 EditText 与键盘一起抬起?
就像在短信应用程序中一样,我希望键盘在弹出时将对话框向上推。我当前遇到的问题是键盘实际上在我的对话框上抬起并且屏幕不滚动。
这就是我想要的:(没有足够的声誉来发布图像)
看看它的效果如何?我该如何去做呢?
Just like in texting applications, I want the keyboard to push the dialog box up when it raises. The issue I'm currently having is that the keyboard actually raises over my dialog box and the screen does not scroll.
Here's what I want: (Don't have enough reputation to post images)
See how nicely it raises? How do I go about doing that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
RelativeLayout
并使用android:layout_alignParentBottom="true"
放置EditText
,然后在显示键盘时它应该会自动升起。Use a
RelativeLayout
and place yourEditText
usingandroid:layout_alignParentBottom="true"
it should then raise automatically when the keyboard is shown.//在清单 xml 文件中尝试 windowsoftinput 模式。
。
参考此
//try windowsoftinput mode in your manifest xml file.
.
ref this