tableView的plain样式的headerView的上拉过程中悬停解决方法

//去掉UItableview headerview黏性(sticky) 去掉header的浮动效果

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    if (scrollView == self.tableView)

    {

        CGFloat sectionHeaderHeight = 100; //sectionHeaderHeight

        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 @ 2016-07-15 16:23  Ninesday  阅读(2050)  评论(0编辑  收藏  举报