ListView自定義 FastScroller滑塊

默認開啓只需要
  <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以上。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章