Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UITableView/UIScrollView ScrollToItemIndex_Iphone_Uiscrollviewdelegate - Fatal编程技术网

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];

正是我想要的。谢谢