Enumeration

UIViewContentMode

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

Declaration

typedef enum UIViewContentMode : NSInteger {
    ...
} UIViewContentMode;

Topics

Constants

UIViewContentModeScaleToFill

The option to scale the content to fit the size of itself by changing the aspect ratio of the content if necessary.

UIViewContentModeScaleAspectFit

The option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.

UIViewContentModeScaleAspectFill

The option to scale the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.

UIViewContentModeRedraw

The option to redisplay the view when the bounds change by invoking the setNeedsDisplay method.

UIViewContentModeCenter

The option to center the content in the view’s bounds, keeping the proportions the same.

UIViewContentModeTop

The option to center the content aligned at the top in the view’s bounds.

UIViewContentModeBottom

The option to center the content aligned at the bottom in the view’s bounds.

UIViewContentModeLeft

The option to align the content on the left of the view.

UIViewContentModeRight

The option to align the content on the right of the view.

UIViewContentModeTopLeft

The option to align the content in the top-left corner of the view.

UIViewContentModeTopRight

The option to align the content in the top-right corner of the view.

UIViewContentModeBottomLeft

The option to align the content in the bottom-left corner of the view.

UIViewContentModeBottomRight

The option to align the content in the bottom-right corner of the view.

See Also

Configuring the Resizing Behavior

contentMode

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

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.