我有这个视图,我想把约束条件添加到主视图的顶部、前导、线索中,但当我想添加它们时,它是灰色的。
检查是否 Layout 属性设置为 Automatic 而不是 Translates Mask Into Constraints 在 Size Inspector 选项卡,在Xcode的右侧。如果您在Xcode的右方设置了 Layout 属性为 Translates Mask Into Constraints 在 Size Inspector.
Layout
Automatic
Translates Mask Into Constraints
Size Inspector