zoukankan      html  css  js  c++  java
  • iOS tableview group时头尾视图间隔大小

    解决:

    一,当使用tableview的格式为group时

    1.先设置

       tableview.sectionHeaderHeight = 0.00001;

         tableview.sectionFooterHeight = 0.000001;

    2.在代理方法里写需要的高度即可

      -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

      {

          return 5;

      }

      - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

      {

        return 5;    

      }

    3.如果要单独设置头视图 或者尾视图 可以如下写法

    //只设置尾视图 不需要头视图

      -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

      {

          return 5;

      }

      - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

      {

        return 0.0001;    

      }

    二:一般不使用group,除非是要限制头尾视图要跟着tableview的滑动而滑动时候

     原创作品,有问题可以留言讨论,谢谢....

     文章内容为本人亲测好使,如解决不了您的问题,请继续研究,如有雷同,纯属巧合

  • 相关阅读:
    高并发系统中的常见问题
    区块链需要解决诸多问题
    什么是“区块链”技术
    github源码开源区块链浏览器
    JavaScript 内存
    行为驱动开发(BDD)
    Vue.js
    Net程序员学习Linux
    Mybatis数据操作
    Metatable和Metamethod(转)
  • 原文地址:https://www.cnblogs.com/ccw-congcong/p/6726160.html
Copyright © 2011-2022 走看看