height
fun Modifier.height(intrinsicSize: IntrinsicSize) =
this then
IntrinsicHeightElement(
height = intrinsicSize,
enforceIncoming = true,
inspectorInfo =
debugInspectorInfo {
name = "height"
properties["intrinsicSize"] = intrinsicSize
},
)
Declare the preferred height of the content to be the same as the min or max intrinsic height of
the content. The incoming measurement Constraints
may override this value, forcing the content
to be either smaller or larger.
See width
for other options of sizing to intrinsic width. Also see height
and heightIn
for
other options to set the preferred height.
Example usage for min intrinsic:
Example usage for max intrinsic:
fun Modifier.height(height: Dp) =
this.then(
SizeElement(
minHeight = height,
maxHeight = height,
enforceIncoming = true,
inspectorInfo =
debugInspectorInfo {
name = "height"
value = height
},
)
)
Declare the preferred height of the content to be exactly height
dp. The incoming measurement
Constraints
may override this value, forcing the content to be either smaller or larger.
For a modifier that sets the height of the content regardless of the incoming constraints see
Modifier.requiredHeight
. See width
or size
to set other preferred dimensions. See
widthIn
, heightIn
or sizeIn
to set a preferred size range.