美文网首页
tableView sectionHeader悬停在指定位置处理

tableView sectionHeader悬停在指定位置处理

作者: 丿小七 | 来源:发表于2020-12-10 22:40 被阅读0次

    在scrollViewDidScroll里实现指定的悬停位置

    
    - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
        CGFloat contentOffsetY = scrollView.contentOffset.y;
      CGFloat sectionHeiderHeight = kNavHeight; //tabler section 悬停在指定位置处理
        if (scrollView.contentOffset.y < sectionHeiderHeight) {
            scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
        }else {
            scrollView.contentInset = UIEdgeInsetsMake(sectionHeiderHeight, 0, 0, 0);
       }
    }
    

    相关文章

      网友评论

          本文标题:tableView sectionHeader悬停在指定位置处理

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