美文网首页
取消tableview header悬停

取消tableview header悬停

作者: 行走的风车 | 来源:发表于2017-09-21 19:57 被阅读137次
//重载scrollview的delegate方法  取消header悬停
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    CGFloat sectionHeaderHeight = 44;
    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);
    }
}

相关文章

网友评论

      本文标题:取消tableview header悬停

      本文链接:https://www.haomeiwen.com/subject/pzptextx.html