SwipeListView 詳解 實現微信,QQ等滑動刪除效果
QQ或者微信出現過滑動,最近聯系人列表,可以刪去當前選中的聯系人,這個功能玩起來很爽 ,
就是試著做了下。其實是使用了開源框架SwipeListView 。

SwipeListView 與一般的ListView使用方式差不多,只是增加了一些特殊功能。
<com.fortysevendeg.swipelistview.SwipeListView
xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/example_lv_list"
android:listSelector="#00000000"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
swipe:swipeFrontView="@+id/front"
swipe:swipeBackView="@+id/back"
swipe:swipeActionLeft="[reveal | dismiss]"
swipe:swipeActionRight="[reveal | dismiss]"
swipe:swipeMode="[none | both | right | left]"
swipe:swipeCloseAllItemsWhenMoveList="[true | false]"
swipe:swipeOpenOnLongPress="[true | false]"
swipe:swipeAnimationTime="[miliseconds]"
swipe:swipeOffsetLeft="[dimension]"
swipe:swipeOffsetRight="[dimension]"
/>
swipeFrontView-ListView Item正常顯示的控件Id,且必須與Item的布局文件中的控件id一樣swipeBackView- 手指滑動時顯示的,隱藏在FrontView后面,且必須與item的布局文件中控件Id一樣swipeActionLeft- 左滑的動作,默認reveal,即顯示BackView,還有dismiss,choice會觸發響應的方法。swipeActionRight- 右滑動作,其他同上swipeMode- Default: 'both' 設置左滑、右滑、都支持swipeCloseAllItemsWhenMoveList- 當滾動listview時,關閉所有展開的Item,最好不要設置為false,由于item的
- 復用,false存在一些問題。
swipeOpenOnLongPress- Default: 'true' 長按時觸發顯示swipeAnimationTime- 動畫時間長度swipeOffsetLeft- left offset 左偏移量swipeOffsetRight- right offset 右偏移量
</ul>