Instance Property

translatesAutoresizingMaskIntoConstraints

A Boolean value that determines whether the view’s autoresizing mask is translated into Auto Layout constraints.

Declaration

@property(nonatomic) BOOL translatesAutoresizingMaskIntoConstraints;

Discussion

If this property’s value is YES, the system creates a set of constraints that duplicate the behavior specified by the view’s autoresizing mask. This also lets you modify the view’s size and location using the view’s frame, bounds, or center properties, allowing you to create a static, frame-based layout within Auto Layout.

Note that the autoresizing mask constraints fully specify the view’s size and position; therefore, you cannot add additional constraints to modify this size or position without introducing conflicts. If you want to use Auto Layout to dynamically calculate the size and position of your view, you must set this property to NO, and then provide a non ambiguous, nonconflicting set of constraints for the view.

By default, the property is set to YES for any view you programmatically create. If you add views in Interface Builder, the system automatically sets this property to NO.

See Also

Laying out Subviews

- layoutSubviews

Lays out subviews.

- setNeedsLayout

Invalidates the current layout of the receiver and triggers a layout update during the next update cycle.

- layoutIfNeeded

Lays out the subviews immediately, if layout updates are pending.

requiresConstraintBasedLayout

A Boolean value that indicates whether the receiver depends on the constraint-based layout system.