TableView去除sectionheader悬浮效果,设置Group去除顶部留白
来源:互联网 发布:开淘宝的心得体会 编辑:程序博客网 时间:2024/06/11 19:27
我采用的是将tableView设置为UITableViewStyleGrouped,但是设置之后需要对界面进行一系列的调整
如何去除tableView的顶部留白?
分组类型的tableView存在默认数值的header与footer,以下为处理方式:
方法一:
(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 0.1;//return CGFLOAT_MIN;}- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return 0.1;//return CGFLOAT_MIN;}
若返回值为0,系统会认为是默认数值而返回默认高度,另外0.1与CGFLOAT_MIN等效.
方法二:
tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, CGFLOAT_MIN)];tableView.tableFooterHeight = 0;
PS:若你需要设置SectionHeader的title,可以将tableHeaderHeight设置为30
参考链接:http://blog.csdn.net/fantasy_jun/article/details/69787408
参考链接:http://blog.sina.com.cn/s/blog_133384b110102wk8b.html
1 0
- TableView去除sectionheader悬浮效果,设置Group去除顶部留白
- tableview didselect去除点击效果
- tableview didselect去除点击效果
- tableView(group)设置顶部空白区域
- tableView plain 去除头视图悬停效果
- 去除tableView底部分割线和顶部header
- 设置tableView的sectionheader的高度
- android TextView去除顶部和底部留白
- iOS tableview cell 去除点击效果 和 选择效果
- Listview 去除顶部阴影
- tableView的sectionHeader粘滞效果和点击展开效果
- tableview 去除footer高度
- Activity顶部悬浮效果
- ListView顶部悬浮效果
- iOS - 如何去除tabbar顶部线条及设置背景图片
- 去除前台顶部“powered by ***** ”
- 去除tabbar顶部分割线
- RecycleView去除自动回滚至顶部
- Training a perceptron via scikit-learn
- C++之友元函数总结
- 2017第八届蓝桥杯总结
- leetcode题解-485. Max Consecutive Ones
- c++虚函数与虚表深度解析
- TableView去除sectionheader悬浮效果,设置Group去除顶部留白
- JVM内存管理------杂谈(借此也论一论obj=null)
- pat甲级1008. Elevator (20)
- 概率DP——HDU 5236
- Leetcode46——Permutations
- JVM内存管理------GC简介
- SPOJ ALL All Discs Considered 搜索
- Mac上Numbers显示.csv中文乱码问题(已解决)
- 桥接与NAT