Believe in your own future, will thank yourself right now Sinner Yun

Sinner_Yun

去掉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  阅读(223)  评论(0编辑  收藏  举报

导航