在scrollViewDidScroll里实现指定的悬停位置
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat contentOffsetY = scrollView.contentOffset.y;
CGFloat sectionHeiderHeight = kNavHeight; //tabler section 悬停在指定位置处理
if (scrollView.contentOffset.y < sectionHeiderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
}else {
scrollView.contentInset = UIEdgeInsetsMake(sectionHeiderHeight, 0, 0, 0);
}
}
网友评论