footer默认的是固定在底部的  但有时我们需要和view一起滚动 

主要是在scrollViewDidScroll这个代理方法中监听滚动的状况

设置如下

 

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

    CGFloat sectionHeaderHeight = 26;//设置你footer高度  这个值根据你自己的实际情况设置
        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);
        }
    
}

相关文章:

  • 2021-05-17
  • 2021-09-14
  • 2021-05-23
  • 2021-12-25
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2021-09-14
  • 2021-05-01
  • 2021-05-31
  • 2021-12-01
  • 2021-11-27
相关资源
相似解决方案