去掉UItableview headerview黏性(sticky)
1 // 去掉UItableview headerview黏性(sticky)
2 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
3 {
4 CGFloat sectionHeaderHeight = 40;
5 if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
6 scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
7 }
8 else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
9 scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
10 }
11 }
让明天,不后悔今天的所作所为
posted on 2016-07-22 16:52 Sinner_Yun 阅读(230) 评论(0) 编辑 收藏 举报