zoukankan      html  css  js  c++  java
  • 让tableview的每个section的headerview随tableview一起滚动

    //去掉UItableview headerview黏性  
    - (void)scrollViewDidScroll:(UIScrollView *)scrollView {  
        if (scrollView == self.myTableView)  
        {  
            CGFloat sectionHeaderHeight = YOUR_HEIGHT;  
            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);  
            }  
        }  
    }

     
  • 相关阅读:
    【UR #17】滑稽树前做游戏
    chage
    [SDOI2016]储能表——数位DP
    password
    groupdel
    [NOI2017]泳池——概率DP+线性递推
    groupadd
    CF986C AND Graph
    userdel
    CF986C AND Graph
  • 原文地址:https://www.cnblogs.com/lxllanou/p/4302568.html
Copyright © 2011-2022 走看看