“添加新约束"复选框和字段被禁用 [英] "Add New Constraints" checkboxes and fields are disabled

查看:29
本文介绍了“添加新约束"复选框和字段被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目要从 Xcode 4.6.3 升级到 Xcode 6.1.1.我在 Xcode 6.1.1 中打开它,并打开每个 .xib.每个 .xib 的格式都按预期更改.我想尝试使用自动布局.使用自动布局被选中,使用大小类也是如此.我将对齐框架中的每个合适的对象更改为对齐矩形.

I have a project I am upgrading from Xcode 4.6.3 to Xcode 6.1.1. I opened it in Xcode 6.1.1, and opened each .xib. The format of each .xib changed as expected. I want to attempt to use auto layout. Use Auto Layout is checked and so is Use Size Classes. I changed every appropriate object from Alignment Frame to be Alignment Rectangle.

有一段时间我无法添加任何约束.然后经过一些尝试,我可以添加一些.查看屏幕截图.
对于选定的视图,我无法添加约束.添加新约束复选框和字段被禁用.只能更改更新帧.我也不能添加对齐约束.按住 Ctrl 键从视图中拖出一条线也不会添加约束.注意视图高度为 411.如果我选​​择另一个对象,然后再次选择视图,高度将更改为父标签栏的高度.如果我继续这样做,高度会越来越小,那么 Xcode 就会崩溃.如何向此视图添加约束?

For a while I couldn’t add any constraints. Then after some trying I could add a few. See the screenshot.
For the selected View, I cannot add a constraint. The Add New Constraints checkboxes and fields are disabled. Only Update Frames is available to be changed. I can’t add an alignment constraint either. Ctrl-drag a line off the view does not add a constraint either. Notice the View height of 411. If I select another object, then select the View again the height will change to be the height of the parent tab bar less. If I keep doing that the height gets smaller and smaller, then Xcode crashes. How can I add a constraint to this view?

标签栏 X、Y、宽度和高度被禁用.当我更改指定视图控制器视图的高度时,标签栏 Y 更改为该值减去标签栏高度 49.当我选择视图时,它的高度现在再次减少 49.选择 Tab Bar,它的 Y 现在少了 49.等等.当我无法添加约束时,如何设置分配的视图控制器视图的尺寸?

The Tab Bar X, Y, Width, and Height are disabled. When I change the Height of the Assigned View Controller View, the Tab Bar Y changes to that value minus the Tab Bar Height of 49. When I select the View, again it’s Height is now 49 less. Select the Tab Bar, it’s Y is now 49 less. And so on. How do I set the dimensions of the Assigned View Controller View that will stick when I cannot add contraints?

推荐答案

我遇到了同样的问题.在我的例子中,视图布局设置被设置为 Translate Mask Into Constraint.我通过在 Size Inspector 中将其更改为 Automatic 来解决它.

I had the same issue. In my case, the view layout setting was set to Translate Mask Into Constraint. I resolved it by changing it to Automatic in Size Inspector.

这篇关于“添加新约束"复选框和字段被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆