码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-02-27 09:53:41      阅读:129      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!