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

让TableViewSection在Plan的模式下不悬浮

时间:2015-06-13 09:56:06      阅读:339      评论:0      收藏:0      [点我收藏+]

标签:ios开发   app   ios   xcode   uiscrollview   

- (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不会悬浮


自己做个笔记

也希望对您有帮助。

让TableViewSection在Plan的模式下不悬浮

标签:ios开发   app   ios   xcode   uiscrollview   

原文地址:http://blog.csdn.net/u014632353/article/details/46475701

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