How to do 'fastScrollEnabled' like ListVie

2019-06-16 11:03发布

问题:

I need fast scroll thumb in ScrollView (which we can scroll by dragging the thumb, like in fastScrollEnabled ListView). Problem detail: The list are rows composed with different TypeFace and alignment.

Row 1:
TextView1 (TypeFace:A & LeftAligned)
TextView2 (TypeFace:B & RightAligned)

Row 2:
TextView3 (TypeFace:A & LeftAligned)
TextView4 (TypeFace:B & RightAligned)
.
.
.

Second requirement: I need to be alerted when the view scrolled, including new scroll position - which is implemented by overriding onScrollChanged method of the ScrollView.

So I use ScrollView cause I though its impossible to implement using ListView.

Suggestion?

回答1:

ScrollView doesn't support fast scroll (unless you do it yourself of course.) However, what you are describing can be achieved with ListView. ListView lets you use several types of views for the list items.