您的位置:首页 > 产品设计 > UI/UE

怎么让tableview的section的headerView随着cell一起滑动

2015-11-26 11:07 357 查看
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
   
if (scrollView ==
self.myTableView)
    {
       
CGFloat sectionHeaderHeight = [AdaptationKit
getVerticalSpace:70];
       
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);
        }
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  uiscrollview