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

size

Declare the preferred size of the content to be exactly a size dp cube.

size

Source set: Android
public fun SubspaceModifier.size(size: Dp): SubspaceModifier

Declare the preferred size of the content to be exactly a size dp cube.

Parameters

size preferred size in Dp for all dimensions.

size

Source set: Android
public fun SubspaceModifier.size(
    width: Dp = Dp.Unspecified,
    height: Dp = Dp.Unspecified,
    depth: Dp = Dp.Unspecified,
): SubspaceModifier

Declare the preferred size of the content to be exactly width dp along the x dimensions, height dp along the y dimensions, and depth dp along the z dimension, of the Composable's local coordinate space.

Parameters

width preferred width in Dp.
height preferred height in Dp.
depth preferred depth in Dp.

size

Source set: Android
public fun SubspaceModifier.size(size: DpVolumeSize): SubspaceModifier

Declare the preferred size of the content to be exactly size in each of the three dimensions. Panels have 0 depth and ignore the z-component of this modifier. Applying rotations to an object will also rotate the xyz axes of this modifier.

Parameters

size preferred volume size as a DpVolumeSize.

Last updated: