今天介绍一个swipemenulistview实现侧滑删除的例子,其实和listview的用法一样,就是多了创建删除等view的步骤,然后通过addview添加到父布局中。
效果如果:
当然你也也可以根据自己的需要增加更多的自定义view。
直接看代码吧:
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下来,自行修改优化