UITableViewStyleGrouped 类型的 tableView 在适配的时候出现很大的问题。记录一下

按照之前的方法,只需要执行以下的代码就能够很好的解决 section == 0 的时候,sectionHeader 的高度问题以及 section 间距的问题


tableView.delegate = self;
tableView.dataSource = self;
tableView.sectionFooterHeight = 0.01f;
tableView.tableFooterView = [UIView new];

通过以下的方法能够良好的解决 sectionHeader 的高度问题,并且是兼容 iOS 10 以及其他版本的


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(, , ScreenWidth, 10.0f)];
return headerView;
} - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if (section == ) {
return 0.01;
}
return ;
}
- (CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section {
return 0.001;
}

最新文章

  1. 用Ant来做一键部署
  2. jquery中取消和绑定hover事件的正确方式
  3. C#中async/await中的异常处理
  4. mvc-5视图和模版
  5. PHP运行出现Notice : Use of undefined constant 的完美解决方案
  6. 分布式系统间通信之RPC的基本概念(六)
  7. 转 shell awk 使用详解
  8. Volist标签
  9. 201771010118马昕璐《面向对象程序设计java》第八周学习总结
  10. 一次请求中,经过 nginx+uWSGI+flask应用程序搭建服务的执行过程
  11. Java File类与文件IO流总结
  12. asp.net Json序列化
  13. PAT 1081 Rational Sum
  14. try--catch--finally中return返回值执行的顺序
  15. 《mysql必知必会》学习_第9章_20180731_欢
  16. 搭建zookeeper单机版以及简单命令的使用
  17. layui时间,table,大图查看,弹出框,获取音频长度,文件上传
  18. static_cast, dynamic_cast, const_cast 三种类型转化的区别
  19. chrome浏览器调试线上文件映射本地文件
  20. 高速改动android系统默认日期方法

热门文章

  1. TypeScript `this` 入参
  2. docker容器的学习笔记
  3. centOS如何灵活管理服务进程
  4. Centos7安装python3和pip3(一)
  5. 非法指令(Illegal Instruction)问题定位
  6. LinuxVIM编辑器用法
  7. limit的优化
  8. Winclone 8 Mac增强汉化版 Windows分区备份迁移工具 8.0.1
  9. vue中is的使用
  10. 开放平台API接口安全策略汇总