使用“空”属性打破NSConstraint错误

时间:2018-11-27 14:25:00

标签: ios autolayout nslayoutconstraint uistackview

基本上,我有一个垂直的UIStackView,其中填充了容器视图。 我在容器视图上看到空属性(?)

"NSLayoutConstraint:0x600000c3ed50 UICollectionView:0x7f954c871000.leading == UIView:0x7f954c5a5330.(null)"

此约束试图与之进行比较?此地址(0x7f954c5a5330)中还有其他不为空的属性(.trailing,.left,.width等),我该如何解决?

我猜想只有在隐藏容器视图时约束才会打破,但是我不确定。

完整输出如下:

"<NSLayoutConstraint:0x600000c3ed50 UICollectionView:0x7f954c871000.leading == UIView:0x7f954c5a5330.(null)>",
"<NSLayoutConstraint:0x600000c3edf0 UIView:0x7f954c5a5330.trailing == UICollectionView:0x7f954c871000.trailing>",
"<NSLayoutConstraint:0x600000c3b7a0 UIView:0x7f954c5a5330.width == 0>",
"<NSLayoutConstraint:0x600000c3f0c0 UILayoutGuide:0x6000016d9960.left == UIView:0x7f954c5a5330.left + 20>" 

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000c3ed50 UICollectionView:0x7f954c871000.leading == UIView:0x7f954c5a5330.(null)>

0 个答案:

没有答案