UIViewContentMode
This page covers the description of the UIViewContentMode enumeration
UIViewContentMode enumeration contains constants that specify the position of a capture device.
1
const UIViewContentMode = {
2
ScaleToFill: 0,
3
ScaleAspectFit: 1,
4
ScaleAspectFill: 2,
5
Redraw: 3,
6
Center: 4,
7
Top: 5,
8
Bottom: 6,
9
Left: 7,
10
Right: 8,
11
TopLeft: 9,
12
TopRight: 10,
13
BottomLeft: 11,
14
BottomRight: 12,
15
}
Copied!
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 modified 1mo ago
Copy link