Android 滚动查看
我有一个布局,其中距视图顶部 75% 的位置有一个 EditText,当它获得焦点时,会显示键盘并且 EditText 自动向上移动。我想问这个行为叫什么,即使没有焦点,我如何通过代码重现这个行为?有没有办法在不使用 ScrollView 的情况下做到这一点?
更新
我想要的是当用户在 EditText 中键入时显示名称建议。由于这是 EditText,因此将显示键盘,并且 EditText 必须位于 x=0 和 y=0 处,以便为建议 ListView 有足够的空间,以便用户可以选择一个。
I have a Layout where there is a EditText at 75% position from top of the view and when it gets focused the keyboard is shown and the EditText automatically moves up. I want to ask what this behaviour is called and how can I reproduce this by code even without it's focused? Is there a way to do that without using ScrollView?
UPDATED
What I want is to show name suggestions as user types in EditText. As this is EditText, the keyboard would be shown and EditText has to be at x=0 and y=0 to have enough space for suggestions ListView so user can pick one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
public voidscrollTo(int x, int y)
另见 smoothscroll
public void scrollTo (int x, int y)
also see smoothscroll