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