【发布时间】:2021-08-05 18:59:57
【问题描述】:
Height is ambiguous for UILabel (topCommentLabel)
Height and vertical position is ambiguous for UIView (commentContainerView)
在tableview单元格中使用
_tableView.rowHeight = UITableViewAutomaticDimension;
我有一个包含 3 个标签的 containerView,我希望 Label 的内容能够支撑 containerView
这是我的约束
{// comment area
[self.commentContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentLabel);
make.top.mas_equalTo(self.contentLabel.mas_bottom).mas_offset(10);
}];
[self.topCommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(0);
}];
[self.bottomCommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.topCommentLabel.mas_bottom).mas_offset(0);
make.left.right.mas_equalTo(0);
}];
[self.readAllCommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.bottomCommentLabel.mas_bottom).mas_offset(0);
make.left.bottom.mas_equalTo(0);
}];
}
视图显示正常,但我收到了模棱两可的警告
为什么会出现此警告,我该如何解决?
【问题讨论】:
标签: ios objective-c autolayout