Instance Property

contentMode

A flag used to determine how a view lays out its content when its bounds change.

Declaration

@property(nonatomic) UIViewContentMode contentMode;

Discussion

The content mode specifies how the cached bitmap of the view’s layer is adjusted when the view’s bounds change. This property is often used to implement resizable controls. Instead of redrawing the contents of the view every time, you can use this property to specify that you want to scale the contents (either with or without distortion) or pin them to a particular spot on the view.

For a list of values you can assign to this property, see UIViewContentMode. The default value of this property is UIViewContentModeScaleToFill.

See Also

Configuring the Resizing Behavior

UIViewContentMode

Options to specify how a view adjusts its content when its size changes.

contentStretch

The rectangle that defines the stretchable and nonstretchable regions of a view.

Deprecated
- sizeThatFits:

Asks the view to calculate and return the size that best fits the specified size.

- sizeToFit

Resizes and moves the receiver view so it just encloses its subviews.

autoresizesSubviews

A Boolean value that determines whether the receiver automatically resizes its subviews when its bounds change.

autoresizingMask

An integer bit mask that determines how the receiver resizes itself when its superview’s bounds change.