Iphone UITableView/UIScrollView ScrollToItemIndex
我想打电话Iphone UITableView/UIScrollView ScrollToItemIndex,iphone,uiscrollviewdelegate,Iphone,Uiscrollviewdelegate,我想打电话 [tableView scrollToItemAtIndex: [tableView indexForCell: firstVisibleCell] atScrollPosition: UITableViewScrollPositionTop animated:YES]; 强制我的表“捕捉”到第一个可见项。这很好,但我只接到一个电话 - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView 必须完成
[tableView scrollToItemAtIndex: [tableView indexForCell: firstVisibleCell] atScrollPosition: UITableViewScrollPositionTop animated:YES];
强制我的表“捕捉”到第一个可见项。这很好,但我只接到一个电话
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
必须完成滚动时(文档中有说明)。我是否可以获取firstVisibleCell的偏移量,以便进行比较以查看是否需要滚动?使用方法-(CGRect)rectforrowatinexpath:(nsindepath*)indepath
:
NSIndexPath *indexPath = [tableView indexForCell:firstVisibleCell];
CGRect rect = [tableView rectForRowAtIndexPath:indexPath];
正是我想要的。谢谢