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 c开发者_运维技巧haracter
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.
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?
精彩评论