找回密码
 立即注册
源代码介绍
列表视图滑动以删除该项目。之前在论坛下载过类似的源代码,但是自己下载后没有看。突然想自己实现滑动删除,所以自己写了一个。他们的水平有限,思路也比较简单,仅供参考。
思路: 1:继承listview,重写onTouchEvent(..)方法监听滑动。
            2:获取滑动位置,转换为listview中对应item的位置。
            3:删除Adapter中对应的list(存储的数据)中的对应数据,更新listview完成一次删除。
Android listview 滑动删除(具体效果360手机卫士后台通知)

(Source code introduction
Slide in the list view to delete the item. I downloaded similar source code in the forum before, but I didn't see it after downloading. I suddenly wanted to realize sliding deletion by myself, so I wrote one myself. Their level is limited and their ideas are relatively simple, which is for reference only.
Idea: 1: inherit listview and rewrite ontouchevent (..) Method.
2: Get the sliding position and convert it to the position of the corresponding item in listview.
3: Delete the corresponding data in the corresponding list (stored data) in the adapter and update listview to complete the deletion.
Android listview sliding deletion (specific effect: 360 mobile guard background notification))

[下载]16520211350.rar




上一篇:Android Gps日志记录程序源码
下一篇:Android MP3播放器源码,带卡拉OK字幕