ConstrainedSize
public struct ConstrainedSize : Element
Constrains the measured size of the contained element in the ranges specified by the width
and height
properties.
There are several constraint types available for each axis. See ConstrainedSize.Constraint
for a full list and in-depth
descriptions of each.
Notes
An important note is that the constraints of ConstrainedSize
are authoritative during measurement. For example,
if your ConstrainedSize
specifies .atLeast(300)
for width
, and the ConstrainedSize
is asked to measure within
a SizeConstraint
that is at most 100 points wide, the returned measurement will still be 300 points. The same goes for the
height of the ConstrainedSize
.
-
The element whose measurement will be constrained by the
ConstrainedSize
.Declaration
Swift
public var wrapped: Element
-
The constraint to place on the width of the element.
Declaration
Swift
public var width: Constraint
-
The constraint to place on the height of the element.
Declaration
Swift
public var height: Constraint
-
Creates a new
ConstrainedSize
with the provided constraint options.Declaration
Swift
public init( width: Constraint = .unconstrained, height: Constraint = .unconstrained, wrapping element: Element )
-
Declaration
Swift
public var content: ElementContent { get }
-
Declaration
Swift
public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription?
-
The available ways to constrain the measurement of a given axis within a
See moreConstrainedSize
element.Declaration
Swift
public enum Constraint : Equatable