天天看點

SwipeListView實作仿ios的側滑

今天介紹一個swipemenulistview實作側滑删除的例子,其實和listview的用法一樣,就是多了建立删除等view的步驟,然後通過addview添加到父布局中。

效果如果:

SwipeListView實作仿ios的側滑

當然你也也可以根據自己的需要增加更多的自定義view。

SwipeListView實作仿ios的側滑

直接看代碼吧:

add swipemenulistview in layout xml

create a swipemenucreator to add items.

listener item click event

use the viewtype of adapter

create different menus depending on the view type

大家可以把代碼fork下來,自行修改優化

繼續閱讀