【问题标题】:UITableView reorder with tap within tableUITableView 在表格内点击重新排序
【发布时间】:2012-07-03 22:02:36
【问题描述】:

给过去使用过 UITableView 的人的一个问题

我目前在编辑模式下使用 UITableView,并且实现了以下数据源/委托方法

  • (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath //which tells me where the cell has been moved to

  • (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath //which tells me where it may be moved

我想要实现的目标: 当我选择一个单元格并对其重新排序时,当手指在表格视图中时,单元格应该在表格视图中上下移动。这意味着如果我从表格视图中开始并移到它之外,单元格应该重新定位,而不是让我重新排列单元格。

问题在于,在执行重新排序时,无法找出(据我所知)我的手指在哪里。如果我能找出手指的位置,那么就有可能实现这一目标。

有什么想法吗?

【问题讨论】:

    标签: ios uitableview


    【解决方案1】:

    看看 (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 函数。 HTH。

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多