在UITableview Plain风格下 SectionHeader在滑动时会始终悬浮在tableview上方,解决办法:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.contentTableView)
{
CGFloat sectionHeaderHeight = 10; //sectionHeaderHeight
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);
}
}
}