如何做到“fastScrollEnabled”就像在滚动型的ListView? [英] How to do 'fastScrollEnabled' like ListView in ScrollView?

查看:173
本文介绍了如何做到“fastScrollEnabled”就像在滚动型的ListView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要快速滚动滑块的滚动型(我们可以通过在fastScrollEnabled ListView控件拖动滑块,像滚动)。问题的细节:该列表中的行由具有不同的字体和排列

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.

行1:结果
TextView1(字体:A和LeftAligned)​​结果
TextView2(字体:B&安培; RightAligned)​​结果

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

第2行:结果
TextView3(字体:A和LeftAligned)​​结果
TextView4(字体:B&安培; RightAligned)​​结果
。结果
。结果

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

第二个要求:我需要的时候滚动视图,包括新的滚动位置被警告 - 这是通过覆盖实施 onScrollChanged 的滚动型的方法

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.

于是我就用滚动型,因为我虽然它不可能使用ListView控件来实现。

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

建议?

推荐答案

滚动型不支持快速滚动(除非你自己做,当然)。但是,你要描述可以用ListView控件来实现的。 ListView控件,您可以使用多种类型的浏览列表项。

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.

这篇关于如何做到“fastScrollEnabled”就像在滚动型的ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆