有人知道如何调试吗?
Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.
行的高度由设置
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 34.0;
}
而且所有的约束
似乎都很开心...
最佳答案
在我的情况下,强制返回高度和估计高度会使警告消失。
- (CGFloat)tableView:(UITableView *)tableView
estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
另一个不需要这两个覆盖的解决方案是在 loadView
或 init 方法中简单地使用 self.tableView.rowHeight = 44;
。
关于objective-c - iOS8 - 约束含糊地暗示高度为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25822324/