Android 列表视图拖放排序 [英] Android List View Drag and Drop sort

查看:36
本文介绍了Android 列表视图拖放排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在列表视图中有一个记录列表,我希望用户能够使用拖放方法重新排序.我已经在其他应用程序中看到了这个实现,但我还没有找到它的教程.它必须是其他人也需要的东西.任何人都可以指出一些代码来执行此操作吗?

I have a list of records in a listview that I want the user to be able to re-sort using a drag and drop method. I have seen this implemented in other apps, but I have not found a tutorial for it. It must be something that others need as well. Can anyone point me to some code for doing this?

推荐答案

我已经为此工作了一段时间.很难做到正确,我并不声称我做到了,但到目前为止我很满意.我的代码和几个演示可以在

I have been working on this for some time now. Tough to get right, and I don't claim I do, but I'm happy with it so far. My code and several demos can be found at

它的使用与 TouchInterceptor(代码所基于的)非常相似,尽管已经做出了重大的实现更改.

Its use is very similar to the TouchInterceptor (on which the code is based), although significant implementation changes have been made.

DragSortListView 在拖动和调整项目时具有平滑且可预测的滚动.项目洗牌与拖动/浮动项目的位置更加一致.支持异构高度列表项.拖动滚动是可定制的(我演示了在一个长列表中快速拖动滚动——不是我想到的应用程序).页眉/页脚受到尊重.等等.??看一看.

DragSortListView has smooth and predictable scrolling while dragging and shuffling items. Item shuffles are much more consistent with the position of the dragging/floating item. Heterogeneous-height list items are supported. Drag-scrolling is customizable (I demonstrate rapid drag scrolling through a long list---not that an application comes to mind). Headers/Footers are respected. etc.?? Take a look.

这篇关于Android 列表视图拖放排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆