Swift 无法同时满足约束-尝试动态调整单元格高度时

Swift 无法同时满足约束-尝试动态调整单元格高度时,swift,uitableview,constraints,Swift,Uitableview,Constraints,我想动态调整一个单元格,以显示我提供给这个特定单元格内标签的所有文本。我有一个自定义单元格,它将文本剪切,并在末尾显示3个点 在viewdidload中尝试此操作时: tableView.estimatedRowHeight = tableView.rowHeight tableView.rowHeight = UITableViewAutomaticDimension a) 它破坏了我的整个布局 b) 显示此错误消息: Unable to simultaneously satisfy con

我想动态调整一个单元格,以显示我提供给这个特定单元格内标签的所有文本。我有一个自定义单元格,它将文本剪切,并在末尾显示3个点

在viewdidload中尝试此操作时:

tableView.estimatedRowHeight = tableView.rowHeight
tableView.rowHeight = UITableViewAutomaticDimension
a) 它破坏了我的整个布局

b) 显示此错误消息:

Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x7faa6a5ab2f0 H:[UIImageView:0x7faa6a5ad100(135)]>",
    "<NSLayoutConstraint:0x7faa6a5b9af0 UIImageView:0x7faa6a5ad100.leading == UITableViewCellContentView:0x7faa6a5acba0.leadingMargin>",
    "<NSLayoutConstraint:0x7faa6a5b9c80 UILabel:0x7faa6a5b3f00'Mercedes-Benz G500 4x4\U00b2 s...'.trailing == UITableViewCellContentView:0x7faa6a5acba0.trailingMargin>",
    "<NSLayoutConstraint:0x7faa6a5b9d20 H:[UIImageView:0x7faa6a5ad100]-(8)-[UILabel:0x7faa6a5b3f00'Mercedes-Benz G500 4x4\U00b2 s...']>",
    "<NSLayoutConstraint:0x7faa6a5c09c0 'fittingSizeHTarget' H:[UITableViewCellContentView:0x7faa6a5acba0(34)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7faa6a5ab2f0 H:[UIImageView:0x7faa6a5ad100(135)]>
无法同时满足约束。
可能下面列表中至少有一个约束是您不想要的。试着这样做:(1)看看每个约束,试着找出你不期望的约束;(2) 找到添加了不需要的约束的代码,然后修复它。(注意:如果您看到不理解的NSAutoresizingMaskLayoutConstraints,请参阅UIView属性TranslatesAutoResizingMaskToConstraints的文档)
(
"",
"",
"",
"",
""
)
将尝试通过打破约束进行恢复

有没有办法从这条错误消息中检查出问题出在这里?

哈哈,好的。回答得好。普通人是否有机会解密错误消息?它用常规语言说什么?问题是标签和图像之间的约束吗?处理它,挂在那里。错误消息只显示水平约束。您有哪些垂直约束,即决定单元格高度的约束?另外:在故事板中,Interface Builder是否有关于您的约束的任何警告/错误?您必须在尝试运行项目之前解决这些问题。以下是我的所有约束:/edit:无警告、无错误、无任何…哈哈,好的。回答得好。普通人是否有机会解密错误消息?它用常规语言说什么?问题是标签和图像之间的约束吗?处理它,挂在那里。错误消息只显示水平约束。您有哪些垂直约束,即决定单元格高度的约束?另外:在故事板中,Interface Builder是否有关于您的约束的任何警告/错误?您必须在尝试运行项目之前解决这些问题。以下是我的所有约束:/edit:无警告、无错误、无任何。。。