requiredSize
public fun SubspaceModifier.requiredSize(size: Dp): SubspaceModifier
Declare the size of the content to be exactly a size dp cube, disregarding the incoming VolumeConstraints. When applied to a Panel, the size will be a size dp square instead.
This is in contrast to SubspaceModifier.size, which respects the parent's constraints. requiredSize will ignore all min and max constraints 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
| size | required size in Dp for all dimensions. |
requiredSize
public fun SubspaceModifier.requiredSize(size: DpVolumeSize): SubspaceModifier
Declare the size of the content to be exactly size in each of the three dimensions of the Composable's local coordinate space, disregarding the incoming VolumeConstraints.
This is in contrast to SubspaceModifier.size, which respects the parent's constraints. requiredSize will ignore all min and max constraints from the incoming constraints, which can be useful for sizing an element to a specific value even if it exceeds the parent's bounds. The parent will then determine how to handle the overflow.
Parameters
| size | required volume size as a DpVolumeSize. |
requiredSize
public fun SubspaceModifier.requiredSize(
width: Dp = Dp.Unspecified,
height: Dp = Dp.Unspecified,
depth: Dp = Dp.Unspecified,
): SubspaceModifier
Declare the size of the content to be exactly width, height, and depth in each of the three dimensions of the Composable's local coordinate space, disregarding the incoming VolumeConstraints.
This is in contrast to SubspaceModifier.size, which respects the parent's constraints. requiredSize will ignore all min and max constraints from the incoming constraints, which can be useful for sizing an element to a specific value even if it exceeds the parent's bounds. The parent will then determine how to handle the overflow.
Parameters
| width | required width in Dp. |
| height | required height in Dp. |
| depth | required depth in Dp. |