Swift 2.0 / UITableViewCell - 在滚动时无法在单元格中处于最高位置

时间:2016-02-09 12:06:08

标签: ios swift uitableview uiscrollview

我的目标是能够自动滚动浏览我的UITableView单元格,同时自动对位于视图顶部可见位置的单元格执行操作。我已经想出了如何使用各种scrollview委托方法自动滚动浏览我的UITableView,但是当我在Feed中的正确位置时,我仍然无法弄清楚如何在所需的单元格上调用动作。

有没有人有任何建议?

1 个答案:

答案 0 :(得分:0)

您可以使用此功能:

      NSIndexPath *indexPath = [NSIndexPath indexPathForRow:desiredrow inSection:desiredsection];
       [yourTableView scrollToRowAtIndexPath:indexPath 
                 atScrollPosition:UITableViewScrollPositionTop 
                         animated:YES];