How to implement scrollbar with thumb for fast scrolling

无人久伴 提交于 2019-12-04 16:59:11

问题


I need to implement a screen having around 1000 thumbnails. This screen should support gesture based scrolling as well as fast scrolling using a scrollbar with thumb. So if user want to move from page 1 to page 100 he can just drag the thumb and reach there.

But there is no such control in Android. There is seek bar but its look and feel is not similar to what I want. I also want to flick and swipe functionality which can be inherited using horizontalscrollbar. So i want to add functionality of horizontal scroolbar as well as of seekbar in my application.

But I am facing some issue to sync thumb position with swipe or flick event and also the seekbar thumb look and feel need to be modified.

Please suggest some clue.


回答1:


ListView thumb support:

ListView vList = ...;
vList.setFastScrollEnabled(true);

GridView thumb support:

GridView vGrid = ...;
vGrid .setFastScrollEnabled(true);

Your can also divide content into sections. In order to to that the adapter must implement following interface:

android.widget.SectionIndexer



回答2:


See this answer. It gives details about how to customize the look of the fast scroll thumb on API level >= 11.



来源:https://stackoverflow.com/questions/2957172/how-to-implement-scrollbar-with-thumb-for-fast-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!