使用android通过拖放重新排序列表视图项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3141144/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:53:54  来源:igfitidea点击:

reordering of listview items by drag and drop using android

android

提问by teksquery

How to drag and drop items in Listview for reordering in android?

如何在Listview中拖放项目以在android中重新排序?

回答by Stefan

Here is our drag & drop list. It is a direct replacement for ListView and it's very easy to use. There are examples of how to use it on the github page.

这是我们的拖放列表。它是 ListView 的直接替代品,非常易于使用。在 github 页面上有如何使用它的示例。

https://github.com/terlici/DragNDropList

https://github.com/terlici/DragNDropList

回答by Terril Thomas

A good example on the topic can be found here: https://github.com/mtparet/Drag-And-Drop-Android

可以在此处找到有关该主题的一个很好的示例:https: //github.com/mtparet/Drag-And-Drop-Android

回答by Dalbergia

This has been discussed elsewhere. Try:

这已在别处讨论过。尝试:

Reordering Lists like playlists in the media player

重新排序列表,如媒体播放器中的播放列表

or

或者

Android - drag and drop - list rearrange

Android - 拖放 - 列表重新排列

Unfortunately, there seems to be no easy way to do it. You'll have to handle touch events at a fairly low level.

不幸的是,似乎没有简单的方法可以做到。您必须在相当低的级别处理触摸事件。

回答by xydev

Check this.. exactly what you needed. Drag and Drop

检查这个..正是你需要的。 拖放