UITableview的组头组尾高度设置无效问题

2017-10-26  本文已影响59人  未来可期me
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section == 1) {
        return 50;
    }
    return 0;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0;
}

后来改成0.1就没问题了,我怀疑是不是设置成0就用了tableview的默认高度了--fuck-找了半天

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section == 1) {
        return 50;
    }
    return 0.1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.1;
}
上一篇 下一篇

猜你喜欢

热点阅读