UITableView的段落设置 — 段头段尾高度

来源:互联网 发布:石油钻井数据与油价 编辑:程序博客网 时间:2024/04/30 11:06

UITableView在段落模式下,段尾即使在代理方法中设置高度为0,也会默认为1,所以,要彻底取消段尾,有两种方法,

1、设置代理方法

只要将段头的颜色设置跟你需要的一样,就可以了。


// 设置了也没什么用
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{</span>
    return 0;}
<span style="font-family: Arial, Helvetica, sans-serif;">- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{</span>
    UIView *bView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENSIZE.width, 1)];    bView.backgroundColor = [Tools getColor:@"FAFAFA"];    return bView;}

2、设置属性


_headTableView.sectionFooterHeight = 0;

设置这个属性可以完美解决段头模式下段头的显示问题。



0 0
原创粉丝点击