UITableViewCell分隔线未对齐

时间:2015-01-28 19:25:46

标签: ios uitableview

当我将tableView.rowHeight设置为57时,其中一个单元格的行高总是错误的。可能是什么原因?我也尝试过实施委托方法而没有运气。 enter image description here

2 个答案:

答案 0 :(得分:1)

在视图控制器中,只需实现以下委托方法

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 57f;
}

答案 1 :(得分:0)

您的自定义单元格高度和heightForRowAtIndexPath返回的高度应该相同。 假设自定义单元格高度为65.并且

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 65f;
}
相关问题