androidx.compose.ui.layout

LayoutModifier

Interface · from org.jetbrains.compose.ui:ui:1.12.2

No hand-written docs yet.

A Modifier.Element that changes how its wrapped content is measured and laid out. It has the same measurement and layout functionality as the androidx.compose.ui.layout.Layout component, while wrapping exactly one layout due to it being a modifier. In contrast, the androidx.compose.ui.layout.Layout component is used to define the layout behavior of multiple children.

interface LayoutModifier : Modifier.Element

Is a

Functions

measure

fun MeasureScope.measure(measurable: Measurable, constraints: Constraints): MeasureResult

The function used to measure the modifier. The measurable corresponds to the wrapped content, and it can be measured with the desired constraints according to the logic of the LayoutModifier. The modifier needs to choose its own size, which can depend on the size chosen by the wrapped content (the obtained Placeable), if the wrapped content was measured. The size needs to be returned as part of a MeasureResult, alongside the placement logic of the Placeable, which defines how the wrapped content should be positioned inside the LayoutModifier. A convenient way to create the MeasureResult is to use the MeasureScope.layout factory function.

minIntrinsicWidth

fun IntrinsicMeasureScope.minIntrinsicWidth(measurable: IntrinsicMeasurable, height: Int): Int

The function used to calculate IntrinsicMeasurable.minIntrinsicWidth.

minIntrinsicHeight

fun IntrinsicMeasureScope.minIntrinsicHeight(measurable: IntrinsicMeasurable, width: Int): Int

The lambda used to calculate IntrinsicMeasurable.minIntrinsicHeight.

maxIntrinsicWidth

fun IntrinsicMeasureScope.maxIntrinsicWidth(measurable: IntrinsicMeasurable, height: Int): Int

The function used to calculate IntrinsicMeasurable.maxIntrinsicWidth.

maxIntrinsicHeight

fun IntrinsicMeasureScope.maxIntrinsicHeight(measurable: IntrinsicMeasurable, width: Int): Int

The lambda used to calculate IntrinsicMeasurable.maxIntrinsicHeight.

Library docs

A Modifier.Element that changes how its wrapped content is measured and laid out. It has the same measurement and layout functionality as the androidx.compose.ui.layout.Layout component, while wrapping exactly one layout due to it being a modifier. In contrast, the androidx.compose.ui.layout.Layout component is used to define the layout behavior of multiple children.