UIViewContentMode

This page covers the description of the UIViewContentMode enumeration

UIViewContentMode enumeration contains constants that specify the position of a capture device.

const UIViewContentMode = {
    ScaleToFill: 0,
    ScaleAspectFit: 1,
    ScaleAspectFill: 2,
    Redraw: 3,
    Center: 4,
    Top: 5,
    Bottom: 6,
    Left: 7,
    Right: 8,
    TopLeft: 9,
    TopRight: 10,
    BottomLeft: 11,
    BottomRight: 12,
}

Constant

Description

ScaleToFill

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

ScaleAspectFit

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.

ScaleAspectFill

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.

Redraw

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

Center

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

Top

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

Bottom

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

Left

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

Right

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

TopLeft

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

TopRight

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

BottomLeft

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

BottomRight

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

For more information, please see the official Apple documentation.

Last updated

Was this helpful?