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

【问题】tableView的每组的头部不不能滚动的解决方案

时间:2015-08-15 18:04:18      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:

- (void)scrollViewDidScroll:(UIScrollView*)scrollView
{
    if (scrollView == self.tableView) {
        CGFloat sectionHeaderHeight = HeaderHeight;
        if (scrollView.contentOffset.y < sectionHeaderHeight && scrollView.contentOffset.y >= - HeaderHeight) {
            scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
        }
        else if (scrollView.contentOffset.y >= sectionHeaderHeight) {
            scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
        }
    }
}

 技术分享

【问题】tableView的每组的头部不不能滚动的解决方案

标签:

原文地址:http://www.cnblogs.com/gaox97329498/p/4732621.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!