有人知道如何调试这个吗?
仅警告一次:检测到约束模糊地表示tableview单元格内容视图的高度为零的情况.我们考虑的是非故意的坍塌,而是使用标准高度.
这些行具有由设置的固定高度
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 34.0;
}
constraints
人似乎都很开心...
有人知道如何调试这个吗?
仅警告一次:检测到约束模糊地表示tableview单元格内容视图的高度为零的情况.我们考虑的是非故意的坍塌,而是使用标准高度.
这些行具有由设置的固定高度
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 34.0;
}
constraints
人似乎都很开心...
在我的例子中,强制返回高度和估计高度使警告消失.
- (CGFloat)tableView:(UITableView *)tableView
estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
不需要这两个重写的另一个解决方案是在loadView
或init方法中使用self.tableView.rowHeight = 44;
.