去掉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     }
让明天,不后悔今天的所作所为
原文地址:https://www.cnblogs.com/-yun/p/5695759.html