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

ConstraintLayoutScope

class ConstraintLayoutScope : ConstraintLayoutBaseScope
kotlin.Any
   ↳ androidx.compose.foundation.layout.ConstraintLayoutBaseScope
   ↳ androidx.compose.foundation.layout.ConstraintLayoutScope

Scope used by the inline DSL of ConstraintLayout.

Summary

Nested classes
inner

Convenience API for creating multiple ConstrainedLayoutReference via createRefs.

Public methods
Modifier

Modifier that defines the constraints, as part of a ConstraintLayout, of the layout element.

ConstrainedLayoutReference

Creates one ConstrainedLayoutReference, which needs to be assigned to a layout within the ConstraintLayout as part of Modifier.constrainAs.

ConstraintLayoutScope.ConstrainedLayoutReferences

Convenient way to create multiple ConstrainedLayoutReferences, which need to be assigned to layouts within the ConstraintLayout as part of Modifier.constrainAs.

Inherited functions
Inherited properties

Public methods

constrainAs

fun Modifier.constrainAs(
    ref: ConstrainedLayoutReference,
    constrainBlock: ConstrainScope.() -> Unit
): Modifier

Modifier that defines the constraints, as part of a ConstraintLayout, of the layout element.

createRef

fun createRef(): ConstrainedLayoutReference

Creates one ConstrainedLayoutReference, which needs to be assigned to a layout within the ConstraintLayout as part of Modifier.constrainAs. To create more references at the same time, see createRefs.

createRefs

fun createRefs(): ConstraintLayoutScope.ConstrainedLayoutReferences

Convenient way to create multiple ConstrainedLayoutReferences, which need to be assigned to layouts within the ConstraintLayout as part of Modifier.constrainAs. To create just one reference, see createRef.