取消UITableViewSection黏滞,让Section跟着滑动

来源:互联网 发布:长沙理工大学网络认证 编辑:程序博客网 时间:2024/06/06 03:14

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

    CGFloat sectionHeaderHeight = 40;

    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);

    }

}

0 0
原创粉丝点击