I have this table view and am unable to add any autolayout constraints. The control drag doesn't work - no constraints show up, and the builder form seems inactive, I can't set any values in there (see below). Autolayout is enabled everywhere across the project, basically on every view. Why is that?
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.
Select the view you would like to constrain. Then tap the button to the right of the one you have selected and use that menu to define your autolayout constraints. If you want it to work for all devices make sure your storyboard is on the wAny hAny size class setting.
Auto Layout constraints allow us to create views that dynamically adjust to different size classes and positions. The constraints will make sure that your views adjust to any size changes without having to manually update frames or positions.
It is because you selected cell or Content View in cell. You can add constrains only to views inside Content View.
UPDATE
Also you may not be able to add constraints to view if this view is top level object (is not a child of parent view).
UPDATE 2
You can add auto layout constraints only to UIViews and their subclasses. In your case you try to add constrains to UITextField which is located inside UINavigationItem (it is not subclass of UIView).
Here you can find the similar issue and answer on it: iOS Autolayout and UIToolbar/UIBarButtonItems
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