系统默认的scrollbar的话,无法长按拖拽,需要在ListView的xml中添加属性。
如下代码:
<ListView android:id="@+id/listView" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:cacheColorHint="#00000000"
android:fastScrollEnabled="true"
android:scrollbars="none"
android:background="#999999" android:divider="@drawable/divider_line">
</ListView>
上面代码的android:fastScrollEnabled="true"就会呈现类似QQ本地浏览文件的效果。
而即使添加了这条代码,系统默认的scrollbar还是存在的,所以再添加代码android:scrollbars="none"。
那么就只剩下快速定位scrollbar了。