ConstrainedAspectRatio
public struct ConstrainedAspectRatio : Element
Constrains the size of the content element to an aspect ratio.
-
Represents how the content should size itself relative to its parent.
See moreDeclaration
Swift
public enum ContentMode : Equatable
-
The element being constrained.
Declaration
Swift
public var wrappedElement: Element
-
The target aspect ratio.
Declaration
Swift
public var aspectRatio: AspectRatio
-
Whether the aspect ratio should be reached by expanding the content element’s size to fill its parent or shrinking it to fit.
Declaration
Swift
public var contentMode: ContentMode
-
Initializes with the given properties.
Declaration
Swift
public init(aspectRatio: AspectRatio, contentMode: ContentMode = .fitContent, wrapping wrappedElement: Element)
Parameters
aspectRatio
The aspect ratio that the content size should match.
contentMode
How the content should size itself relative to its parent.
wrapping
The content element.
-
Declaration
Swift
public var content: ElementContent { get }
-
Declaration
Swift
public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription?