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

        }

    }

}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM