您的位置:首页 > 移动开发

让TableViewSection在Plan的模式下不悬浮

2015-06-12 21:30 399 查看
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    CGFloat sectionHeaderHeight =
50;
    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中加入ScrollView这个代理方法。
在Plan的模式下
Section不会悬浮

自己做个笔记
也希望对您有帮助。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息