Google is committed to advancing racial equity for Black communities. See how.

StackScope

@Immutable class StackScope
kotlin.Any
   ↳ androidx.compose.foundation.layout.StackScope

A StackScope provides a scope for the children of a Stack.

Summary

Public constructors

A StackScope provides a scope for the children of a Stack.

Public methods
Modifier
Modifier.align(alignment: Alignment)

Pull the content element to a specific Alignment within the Stack.

Modifier

Modifier

Size the element to match the size of the Stack after all other content elements have been measured.

Public constructors

<init>

StackScope()

A StackScope provides a scope for the children of a Stack.

Public methods

align

@Stable fun Modifier.align(alignment: Alignment): Modifier

Pull the content element to a specific Alignment within the Stack. This alignment will have priority over the Stack's alignment parameter.

gravity

@Stable fun Modifier.gravity(align: Alignment): Modifier

Deprecated.

matchParentSize

@Stable fun Modifier.matchParentSize(): Modifier

Size the element to match the size of the Stack after all other content elements have been measured.

The element using this modifier does not take part in defining the size of the Stack. Instead, it matches the size of the Stack after all other children (not using matchParentSize() modifier) have been measured to obtain the Stack's size. In contrast, a general-purpose Modifier.fillMaxSize modifier, which makes an element occupy all available space, will take part in defining the size of the Stack. Consequently, using it for an element inside a Stack will make the Stack itself always fill the available space.