美文网首页
取消TableView风格为Plain时header的悬停效果

取消TableView风格为Plain时header的悬停效果

作者: KKFantasy | 来源:发表于2016-07-20 19:36 被阅读0次
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    CGFloat sectionHeaderHeight = tableHeaderHeight;
    if (scrollView == self.table) {
        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);
        }
    }
}

参考链接:
Change Default Scrolling Behavior of UITableView Section Header

相关文章

网友评论

      本文标题:取消TableView风格为Plain时header的悬停效果

      本文链接:https://www.haomeiwen.com/subject/dgnvjttx.html