#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);
}
}
时间: 2024-11-06 01:23:18