Instance Method

setContentHuggingPriority:forOrientation:

Sets the priority with which a view resists being made larger than its intrinsic size.

Declaration

- (void)setContentHuggingPriority:(NSLayoutPriority)priority forOrientation:(NSLayoutConstraintOrientation)orientation;

Parameters

priority

The new priority.

orientation

The orientation for which the content hugging priority should be set.

Discussion

Custom views should set default values for both orientations on creation, based on their content, typically to NSLayoutPriorityDefaultLow or NSLayoutPriorityDefaultHigh. When creating user interfaces, the layout designer can modify these priorities for specific views when the overall layout design requires different tradeoffs than the natural priorities of the views being used in the interface.

Subclasses should not override this method.

See Also

Measuring in Auto Layout

fittingSize

The minimum size of the view that satisfies the constraints it holds.

intrinsicContentSize

The natural size for the receiving view, considering only properties of the view itself.

- invalidateIntrinsicContentSize

Invalidates the view’s intrinsic content size.

- contentCompressionResistancePriorityForOrientation:

Returns the priority with which a view resists being made smaller than its intrinsic size.

- setContentCompressionResistancePriority:forOrientation:

Sets the priority with which a view resists being made smaller than its intrinsic size.

- contentHuggingPriorityForOrientation:

Returns the priority with which a view resists being made larger than its intrinsic size.