iOS让UITableView的表头随着tableView一块儿滚动。

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

    

    CGFloat sectionHeaderHeight = 40;3d

    

    if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {orm

        

        scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);io

        

    } else if (scrollView.contentOffset.y>=sectionHeaderHeight) {scroll

        

        scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);margin

        

    }top

    

}ant

相关文章
相关标签/搜索