MeasureScope

interface MeasureScope : Density


The receiver scope of a layout's measure lambda. The return value of the measure lambda is MeasureResult, which should be returned by layout

Based on androidx.compose.ui.layout.MeasureScope.

Summary

Public functions

open MeasureResult
layout(width: Int, height: Int, depth: Int, placementBlock: Placeable.PlacementScope.() -> Unit)

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic.

Inherited functions

From androidx.compose.ui.unit.Density
open Int
open Int
open Dp
open Dp
open DpSize
open Float
open Float
open Rect
open Size
open TextUnit
open TextUnit

Inherited properties

From androidx.compose.ui.unit.Density

Public functions

layout

Added in 1.0.0-alpha04
open fun layout(width: Int, height: Int, depth: Int, placementBlock: Placeable.PlacementScope.() -> Unit): MeasureResult

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. The placementBlock is a lambda used for positioning children. Placeable.placeAt should be called on children inside placementBlock.

Parameters
width: Int

the measured width of the layout, in pixels

height: Int

the measured height of the layout, in pixels

depth: Int

the measured depth of the layout, in pixels

placementBlock: Placeable.PlacementScope.() -> Unit

block defining the children positioning of the current layout