Reorder elements of ListView by dragging [duplicate]

最后都变了- 提交于 2019-12-09 13:48:15

问题


I see it done a lot lately on android: I can drag an item in a listView to another position in the list. But I can't seem to find any example code. Does anyone have some example code they don't mind sharing. I have been reading http://developer.android.com/guide/topics/ui/drag-drop.html, but I am not making much progress.

Complication

So I find what seems to be a simple way to accomplish the drag-sort (http://ericharlow.blogspot.com/2010/10/experience-android-drag-and-drop-list.html). But my child views are clickable themselves, and that seem to block the parent ListView from seeing my drag events. Any ideas how to fix this?


回答1:


The bauerca listview is a possibility...this SO post deals with the fact that it is somewhat complicated, and offers a library to consolidate things; the Git source code can be found here. Good Luck, it worked for me with some difficulty!



来源:https://stackoverflow.com/questions/18392943/reorder-elements-of-listview-by-dragging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!