UITableView的plain样式下,取消区头停滞效果
核心代码
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = sectionHead.height; // 区头高度 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); } }