首页 > 其他 > 详细

有关Tableview滑动出现的问题

时间:2017-09-27 18:45:34      阅读:247      评论:0      收藏:0      [点我收藏+]

#pragma mark section不悬停

static CGFloat const sectionHeight = 12.0f;//section的高度值

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

    CGFloat sectionHeaderHeight = sectionHeight;

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

    }

 }

//解决搜索滑动后view下移的问题

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

    CGFloat off_y = scrollView.contentOffset.y;

    if (off_y < 0) {

        self.tableView.contentOffset = CGPointMake(0, 0);

    }

}

有关Tableview滑动出现的问题

原文:http://www.cnblogs.com/jiangxue-iOS/p/7602971.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!