处理TableVIew SectionHeader悬停问题

1,plain类型的tableview  才会悬停  grouped类型不会悬停

 

2,通过改变contentInset达到部分悬停遮罩的处理,对所有的Sectionheader都有效,不可以单独处理某一个sectionheader

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

{

    

        CGFloat sectionHeaderHeight = XX;

    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);

    }

}

 

posted @ 2019-10-08 21:14  怀达  阅读(1055)  评论(0编辑  收藏  举报