#pragma mark section不懸停spa
static CGFloat const sectionHeight = 12.0f;//section的高度值io
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {table
CGFloat sectionHeaderHeight = sectionHeight;搜索
if (scrollView.contentOffset.y <= sectionHeaderHeight && scrollView.contentOffset.y>=0) {scroll
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);static
} else if (scrollView.contentOffset.y >= sectionHeaderHeight) {tab
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);view
}vi
}co
//解決搜索滑動後view下移的問題
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGFloat off_y = scrollView.contentOffset.y;
if (off_y < 0) {
self.tableView.contentOffset = CGPointMake(0, 0);
}
}