首页 > 代码库 > iOS 去掉UItableview header(footer)view黏性(sticky)?

iOS 去掉UItableview header(footer)view黏性(sticky)?

#pragma mark -- UIScrollViewDelegate 代理

#pragma mark 去掉UItableview headerview黏性(sticky)

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

    }

}

iOS 去掉UItableview header(footer)view黏性(sticky)?