ContentMode
public enum ContentMode : Equatable
Represents how the content should size itself relative to its parent.
-
The content will be sized to fit within its parent while maintaining the specified aspect ratio.
If the parent is unconstrained in one dimension, the element will fit the constrained dimension.
If the parent is unconstrained in both dimensions, this element will report a size of
infinity
.Declaration
Swift
case fitParent
-
The content will grow in whichever dimension is needed to maintain the aspect ratio, while ensuring the content still fits.
This mode does not take the parents applied size constraint into account, so the parent may ultimately layout the element without the constrained aspect ratio.
Declaration
Swift
case fitContent
-
The content will shrink in whichever dimension is needed to maintain the aspect ratio, meaning it may be smaller in one dimension than the measured size.
This mode does not take the parents applied size constraint into account, so the parent may ultimately layout the element without the constrained aspect ratio.
Declaration
Swift
case shrinkContent