【问题标题】:reordering of listview items by drag and drop using android使用 android 通过拖放重新排序列表视图项
【发布时间】:2011-03-09 15:24:02
【问题描述】:

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

【问题讨论】:

标签: android


【解决方案1】:

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

Reordering Lists like playlists in the media player

Android - drag and drop - list rearrange

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

【讨论】:

    【解决方案2】:

    检查这个.. 正是您需要的。 Drag and Drop

    【讨论】:

    • 这个拖放示例不能完全工作。如果您的 ListView 的 tiems 超出屏幕的大小,则在您尝试拖动时它不会滚动。改用这个:github.com/commonsguy/cwac-touchlist
    【解决方案3】:

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

    【讨论】:

      【解决方案4】:

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

      https://github.com/terlici/DragNDropList

      【讨论】:

      • 适配器内部传递了游标参数。你能给出任何使用这个库的示例代码吗?
      猜你喜欢
      • 2018-03-13
      • 2018-01-25
      • 1970-01-01
      • 2020-04-05
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多