self.headerHeight
为头视图的高度
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
if (scrollView == self.tempTableview) {
if (scrollView.contentOffset.y <= self.headerHeight && scrollView.contentOffset.y >= 0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
}else{
if (scrollView.contentOffset.y > self.headerHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-self.headerHeight, 0, 0, 0);
}
}
}
}
网友评论