Skip to content

Instantly share code, notes, and snippets.

@piaoapiao
Created February 25, 2014 06:09
Show Gist options
  • Save piaoapiao/9203619 to your computer and use it in GitHub Desktop.
Save piaoapiao/9203619 to your computer and use it in GitHub Desktop.
section 和 cell 整体移动
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.cardTableView)
{
CGFloat sectionHeaderHeight = 80;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
}
http://www.cocoachina.com/bbs/read.php?tid=86162&keyword=section%7Ctableview
http://www.cocoachina.com/bbs/simple/?t138385.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment