Contents

imageContentMode

A property that determines the layout of a background image in a view when its bounds change.

Declaration

var imageContentMode: UIView.ContentMode { get set }

Discussion

The content mode specifies how the background image adjusts when the view’s bounds change. You can use this property to specify that you want to scale the background image (either with or without distortion) or pin it to a particular spot on the view.

For a list of values you can assign to this property, see UIView.ContentMode. The default value of this property is UIView.ContentMode.scaleToFill.

See Also

Customizing the background