{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

BoxWithConstraintsScope

public interface BoxWithConstraintsScope extends BoxScope


Receiver scope being used by the children parameter of BoxWithConstraints

Summary

Public methods

abstract @NonNull Constraints

The constraints given by the parent layout in pixels.

abstract @NonNull Dp

The maximum height in Dp.

abstract @NonNull Dp

The maximum width in Dp.

abstract @NonNull Dp

The minimum height in Dp.

abstract @NonNull Dp

The minimum width in Dp.

Inherited methods

From androidx.compose.foundation.layout.BoxScope
abstract @NonNull Modifier
orgKt.align(@NonNull Modifier receiver, @NonNull Alignment alignment)

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

abstract @NonNull Modifier

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

Public methods

getConstraints

abstract @NonNull Constraints getConstraints()

The constraints given by the parent layout in pixels.

Use minWidth, maxWidth, minHeight or maxHeight if you need value in Dp.

getMaxHeight

abstract @NonNull Dp getMaxHeight()

The maximum height in Dp.

See also
constraints

for the values in pixels.

getMaxWidth

abstract @NonNull Dp getMaxWidth()

The maximum width in Dp.

See also
constraints

for the values in pixels.

getMinHeight

abstract @NonNull Dp getMinHeight()

The minimum height in Dp.

See also
constraints

for the values in pixels.

getMinWidth

abstract @NonNull Dp getMinWidth()

The minimum width in Dp.

See also
constraints

for the values in pixels.