iOS当设置TableView为Group时如何隐藏第一行的间隔

来源:互联网 发布:mycat连接mysql 编辑:程序博客网 时间:2024/06/05 18:54
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{    if (section == 0)        return 0.0f;    return 5.0f;}
这种做法并不可以隐藏第一行的间隔,因为return 0.0f 会让系统返回一个间隔的默认值
正确地做法如下:
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{    if (section == 0)        return CGFLOAT_MIN;    return tableView.sectionHeaderHeight;}
0 0