Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

requiredHeight

Declare the size of the content to be exactly height dp along the y dimension of the Composable's local coordinate space, disregarding the incoming VolumeConstraints.

requiredHeight

Source set: Android
public fun SubspaceModifier.requiredHeight(height: Dp): SubspaceModifier

Declare the size of the content to be exactly height dp along the y dimension of the Composable's local coordinate space, disregarding the incoming VolumeConstraints.

This is in contrast to SubspaceModifier.height, which respects the parent's constraints. requiredHeight will ignore the minHeight and maxHeight from the incoming constraints, which can be useful for sizing an element to a specific value even if it exceeds the parent's bounds.

Parameters

height required height in Dp.

Last updated: