spacedBy

Place children such that each two adjacent ones are spaced by a fixed space distance across the main axis. The spacing will be subtracted from the available space that the children can occupy. The space can be negative, in which case children will overlap.

To change alignment of the spaced children horizontally or vertically, use spacedBy overloads with alignment parameter.

Parameters

space

The space between adjacent children.


Place children horizontally such that each two adjacent ones are spaced by a fixed space distance. The spacing will be subtracted from the available width that the children can occupy. An alignment can be specified to align the spaced children horizontally inside the parent, in case there is empty width remaining. The space can be negative, in which case children will overlap.

Parameters

space

The space between adjacent children.

alignment

The alignment of the spaced children inside the parent.


@Stable
fun spacedBy(space: Int, alignment: Alignment.Vertical): Arrangement.Vertical

Place children vertically such that each two adjacent ones are spaced by a fixed space distance. The spacing will be subtracted from the available height that the children can occupy. An alignment can be specified to align the spaced children vertically inside the parent, in case there is empty height remaining. The space can be negative, in which case children will overlap.

Parameters

space

The space between adjacent children.

alignment

The alignment of the spaced children inside the parent.