The second Android 11 Developer Preview is now available, test it out and share your feedback.

Constrain

@Stable data class Constrain : LayoutModifier
kotlin.Any
   ↳ androidx.ui.layout.LayoutHeight.Constrain

Modifies the height of a Compose UI layout element to be at least minHeight and at most maxHeight tall if permitted by its parent.

This modifies the incoming Constraints provided by a layout element's parent. If the incoming constraints do not allow the modified size, the incoming constraints from the parent will restrict the final size.

Summary

Public constructors

<init>(minHeight: Dp, maxHeight: Dp)

Modifies the height of a Compose UI layout element to be at least minHeight and at most maxHeight tall if permitted by its parent.

Properties

Dp

Dp

Public constructors

<init>

Constrain(
    minHeight: Dp,
    maxHeight: Dp)

Modifies the height of a Compose UI layout element to be at least minHeight and at most maxHeight tall if permitted by its parent.

This modifies the incoming Constraints provided by a layout element's parent. If the incoming constraints do not allow the modified size, the incoming constraints from the parent will restrict the final size.

Properties

maxHeight

val maxHeight: Dp

minHeight

val minHeight: Dp