美文网首页
去除tableview 在plain下,组标题悬浮状态

去除tableview 在plain下,组标题悬浮状态

作者: 落寒z | 来源:发表于2017-01-16 16:52 被阅读53次

原理就是进行偏移放到navigationBar底部

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    CGFloat sectionHeaderHeight = kPixToRealH(48);
    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 在plain下,组标题悬浮状态

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