Android組件:Pinned-section-listview

類似系統聯系人頭部拼音推擠效果。

它實現的功能包括:

  • Fast scroll
  • Headers and footers
  • Clickable pinned sections
  • </ul>

    用法:

    1. Replace standard ListView with com.hb.views.PinnedSectionListView in your layout.xml file.

      <com.hb.views.PinnedSectionListView
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" 
          />
    2. Extend your ListAdapter in a way that it implements PinnedSectionListAdapter interface, in addition to what it already implements. Basically you need to add a single isItemViewTypePinned(int viewType) method. This method must return true for all view types which have to be pinned.

      // Our adapter class implements 'PinnedSectionListAdapter' interface
      class MyPinnedSectionListAdapter extends BaseAdapter implements PinnedSectionListAdapter {
      
           ...
      
           // We implement this method to return 'true' for all view types we want to pin
           @Override
           public boolean isItemViewTypePinned(int viewType) {
               return viewType == <type to be pinned>;
           }
      }

      Android組件:Pinned-section-listview  Android組件:Pinned-section-listview  Android組件:Pinned-section-listview

      項目主頁:http://www.baiduhome.net/lib/view/home/1388495013531

     本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
     轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
     本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!