设置tableview 的section不停靠

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {  

CGFloat sectionHeaderHeight = 40;  

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); 

}

}

猜你喜欢

转载自blog.csdn.net/u012498386/article/details/78477213