输入搜索文本时重置列表滚动位置
在提供一组新建议时,如何将列表滚动位置重置到顶部?
向搜索对话框提供自定义搜索建议时,向下滚动列表后输入更多字符时,滚动位置不会重置建议清单。
当配置为查找联系人时,可以在快速搜索框中轻松重现这一点:
- 打开 QSB
- 从语料库选项中选择“联系人”
- 输入可生成多个全屏结果的内容 >,说“a”
- 向上滑动以显示列表底部的建议
键盘软输入键盘将隐藏,显示建议的全高度列表视图。并且滚动位置现在远离顶部
- 重新点击搜索文本并添加一个字符
尽管出现光标重新查询和新建议,但列表不会滚动回顶部 em>
我对搜索对话框的使用也遇到了同样的问题,而且用户体验很差。我正在从 HTTP API 提供自定义建议,
我注意到其他语料库选项将其建议限制为仅一个屏幕高度的建议,从而完全避免了此问题。
How can I reset the list scroll position to the top when providing a new set of suggestions?
When providing custom search suggestions to the Search Dialog the scroll position doesn't reset when typing more characters after scrolling down the suggestions list.
This is easy to reproduce in the Quick Search Box when configured to look for contacts:
- Open QSB
- Select Contacts from the corpus options
- Type in something that yields more than one full screen of results, say "a"
- Swipe up to reveal suggestions from the bottom of the list
The keyboard soft-input keyboard will hide, revealing a full height list-view of suggestions. And the scroll position is now away from the top
- Tap back into the search text and add a character
Although the cursor re-queries and new suggestions are presented, the list does not scroll back to the top
My use of the Search Dialog suffers the same behaviour, and the user experience is poor. I am providing custom suggestions from an HTTP API that
I've noted that the other corpus options limit their suggestions to only one screen-height of suggestions, avoiding this problem altogether.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当用户输入更多字符时,尝试使用 ListView 的“smoothScrollToPosition(0)”滚动回第一个条目。这就是你所说的重置列表的意思吗?
Try using ListView's "smoothScrollToPosition(0)" to scroll back to the first entry when the user types in more characters. Is that what you mean by resetting the list?