简体   繁体   English

Xcode 6和约束-灰色等宽选项

[英]Xcode 6 and Constraints - Greyed out equal widths option

I am trying to use the constraints on xcode 6 with side-by-side objects but when I use the "add missing constraints" option, all of the elements resize properly except the side-by-side buttons where they stay the same size but one gets pushed out of the view. 我正在尝试对并排对象使用xcode 6上的约束,但是当我使用“添加缺少的约束”选项时,所有元素的大小都会正确调整,但并排按钮的大小保持不变,但是一个人被赶出了视野。

Image of View 视图的图像

And I think I need to use the "Equal heights" constraint but it is greyed out :( 而且我认为我需要使用“等高”约束,但是它灰显:(

Greyed out constraint Image 灰色约束图像

Can anyone help? 有人可以帮忙吗?

您需要右键单击从一个对象到另一对象的拖动以启用该选项(它需要知道什么高度应该相等)

You can also: 你也可以:

  1. In the Xcode document outline use Shift or Command and click on the items you want to add the equal size constraint to. 在Xcode文档的大纲中,使用Shift或Command,然后单击要添加相同大小约束的项目。
  2. Then click the Pin button. 然后单击“固定”按钮。
  3. You can now click the checkbox to add 'equal width' or 'equal height' constraints. 现在,您可以单击复选框以添加“等宽”或“等高”约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM