- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat y = scrollView.contentOffset.y;
for (NSInteger i = 0; i < self.models.count; i ++) {
CGFloat offset = [self.tableView rectForSection:i].origin.y;
CGFloat height = [self.tableView rectForSection:i].size.height;
if (y >= offset && y <= offset + height) {
// 滚动到第 i 组
}
}
}
网友评论