首页 > 其他 > 详细

让tableview的每个section的headerview随tableview一起滚动

时间:2015-02-27 09:52:14      阅读:389      评论:0      收藏:0      [点我收藏+]

//去掉UItableview headerview黏性  
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {  
    if (scrollView == self.myTableView)  
    {  
        CGFloat sectionHeaderHeight = YOUR_HEIGHT;  
        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的每个section的headerview随tableview一起滚动

原文:http://www.cnblogs.com/lxllanou/p/4302568.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!