2

我想像这两种方法一样移动单元格:

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath;
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;

在我使用上面的这些方法移动单元格(通过用户的触摸操作)之前,必须首先调用 tableView 的 setEditing:animated:。

但我想要的是用户长按然后拖动一个单元格来移动它而不进入编辑样式,我希望这些移动视图不会出现在单元格的右边,像这样:

在此处输入图像描述

有什么建议吗?特别感谢!

4

1 回答 1

1

一种解决方案: http: //b2cloud.com.au/how-to-guides/reordering-a-uitableviewcell-from-any-touch-point

但它不能使用长按手势开始拖动

我们可以使用FMMoveTableView来做到这一点。

于 2012-06-26T16:33:07.313 回答