本文介绍了Xcode视图层次结构调试视图中的灰色约束是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道固体是什么:我自己创造了它们。那些灰色的呢?隐含的,可能是通过尺寸适合?灰色高度与实心高度冲突。灰色的来自哪里?

I know what the solid ones are: I created them myself. What about the gray ones? Implicit, maybe via size-to-fit? The gray height conflicts with the solid height. Where do the gray ones come from?

推荐答案

您正在检查对象,例如具有内在内容大小的标签。内在内容大小会产生高度和宽度限制;这就是 的内在内容大小。灰色约束向您显示内在内容大小生成的约束。如果你只是,你可以:他们说内容大小!

You are inspecting an object such as a label that has an intrinsic content size. The intrinsic content size generates height and width constraints; that's what intrinsic content size is. The constraints in gray are showing you the constraints that the intrinsic content size generates. If you just look at them, you can see that: they say "content size"!

他们是灰色,因为它们被显式约束覆盖(它们的优先级较低)。但他们仍然在那里,如果你没有压倒他们,他们会生效(他们不会是灰色的)。

They are in gray because they are overridden by your explicit constraints (they have a lower priority). But they are still there, and if you were not overriding them, they would take effect (and they would not be gray).

这篇关于Xcode视图层次结构调试视图中的灰色约束是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-20 00:52