美文网首页
UITableview的组头组尾高度设置无效问题

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

作者: 未来可期me | 来源:发表于2017-10-26 10:48 被阅读59次
- (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;
}

相关文章

网友评论

      本文标题:UITableview的组头组尾高度设置无效问题

      本文链接:https://www.haomeiwen.com/subject/vnbhpxtx.html