Constrain

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

Modifies the height of a Compose UI layout element to be at least minWidth wide and minHeight tall, and at most minWidth wide and 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>(minSize: Dp, maxSize: Dp)

Modifies a Compose UI layout element to have a square minimum size of minSize and a square maximum size of maxSize.

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

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

Properties

Dp

Dp

Dp

Dp

Public constructors

<init>

Constrain(
    minSize: Dp,
    maxSize: Dp)

Modifies a Compose UI layout element to have a square minimum size of minSize and a square maximum size of maxSize.

<init>

Constrain(
    minWidth: Dp,
    minHeight: Dp,
    maxWidth: Dp,
    maxHeight: Dp)

Modifies the height of a Compose UI layout element to be at least minWidth wide and minHeight tall, and at most minWidth wide and 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

maxWidth

val maxWidth: Dp

minHeight

val minHeight: Dp

minWidth

val minWidth: Dp