I am trying to add layout constraints to my NIB, and i am following the directions apple provides here:
http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/030-Edit_User_Interfaces/edit_user_interface.html
It says this with regards to adding constraints:
To add a constraint Select the object or objects for which you want to add the constraint.
Choose a constraint from the Editor > Add Constraint menu or an alignment type from the Editor > Alignment menu.
That Add Constraint menu is no where to be found. What gives? How can i add constraints??
To create constraints select the button and click the Align icon in the auto layout menu. A popover menu will appear, check both “Horizontal in container” and “Vertically in container” options to center the button on the screen. Then click the “Add 2 Constraints” button. Run the application.
Open the Align menu with the yellow button selected and check Horizontally in Container, then click Add 1 Constraint. Now, select both buttons at the same time using the Shift key and, in the Align menu, check Leading Edges. Again, actually install the constraint by clicking Add 1 Constraint.
That documentation is incorrect.
Constraints are added via the buttons in the lower right corner of the Interface Builder workspace in Xcode 4.6:
The button on the left is for alignment-based constraints, and the middle one (the "I-beam") is for pinning spacing/heights.
In Xcode 5.0, those buttons look a little different, but the features are very similar:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With