"Add new restrictions" checkboxes and fields are disabled

I have a project that I am upgrading from Xcode 4.6.3 to Xcode 6.1.1. I opened it in Xcode 6.1.1 and opened every .xib. The format of each .xib has changed as expected. I want to try using auto-layout. Use auto-layout, and use usage classes. I changed every suitable object from the alignment frame to be an alignment rectangle.

For a while I could not add any restrictions. Then, after some attempts, I could add a few. See screenshot.
enter image description here For the selected view, I cannot add a restriction. Flags and fields Add new restrictions are disabled. Only frame updates are available. I can add an alignment constraint too. Ctrl-dragging a row from a view does not add a limit. Note the height of the 411 view. If I select another object and then select View again, the height will change to a lower height of the parent tab bar. If I keep doing that the height is getting smaller and smaller, then Xcode crashes. How to add a restriction to this view?

The tab bar X, Y, Width and Height are disabled. When I change the height of the presentation of the assigned controller view, the tab bar Y changes this value minus the height of the tab bar 49. When I select View, again its height is now 49 smaller. Select the tab bar, its Y is now 49 smaller. And so on. How do I set the dimensions of an Assigned View Controller View to stick to if I cannot add constraints?

+6
source share
3 answers

Zev has an answer. You cannot add constraints directly to the top-level view in the view controller.

As for the viewing height, decreasing when you select it, I started with the original .xib, making small changes and taking notes. When I checked Use Auto Layout and User Size Class, I received a warning that the document would no longer be compatible with Xcode 5. The window frame size changed from 320 568 to 600 600. ibExternalTranslatesAutoresizingMaskIntoConstraints moved from 1 to 0. Other changes looked like Well. Adding constraints to the objects contained in the View one by one view, I get good results. Behavior The decrease in viewing height when I selected it disappeared.

+2
source

The trick to include restrictions in the root representation:

  • Inside XIB, drag the new view, which will have a sibling, to the initial root. Look.
  • Move the initial root view to a sibling view. It will be able to have its own limitations.
  • Move the initial view back to be the root.
  • Remove the empty sibling view.
0
source

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

0
source

Source: https://habr.com/ru/post/982120/


All Articles