现在的位置: 首页 > 综合 > 正文

ListView自定义 FastScroller滑块

2018年08月30日 ⁄ 综合 ⁄ 共 575字 ⁄ 字号 评论关闭
默认开启只需要
  <ListView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/listView"
        android:fastScrollEnabled="true"
 />
而且会自动隐藏
如果需要自己定义:
(可以参考Deskclock里  com.android.deskclock/.worldclock.CitiesActivity)
    <style name="CitiesTheme" parent="SettingsTheme">
        <item name="android:fastScrollThumbDrawable">@drawable/red_fastscroll_thumb</item> 
    </style>
    
不自动隐藏
listView.setFastScrollAlwaysVisible(true);
功能虽小,不过用户体验我觉得还是很不错的~~
该功能需要API lever 11以上。

抱歉!评论已关闭.