问题
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