Join us for ⁠#Android11: The Beta Launch Show on June 3!

Fill

@Stable object Fill : LayoutModifier
kotlin.Any
   ↳ androidx.ui.layout.LayoutHeight.Fill

Modifies the height of a Compose UI layout element to fill all available space.

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.

Example usage:

import androidx.ui.foundation.Box
import androidx.ui.foundation.drawBackground
import androidx.ui.layout.fillMaxHeight
import androidx.ui.layout.preferredSize

Box(Modifier.fillMaxHeight(), backgroundColor = Color.Red, gravity = ContentGravity.Center) {
    Box(Modifier.preferredSize(100.dp).drawBackground(Color.Magenta))
}

Summary

Public methods

Constraints
Density.modifyConstraints(constraints: Constraints, layoutDirection: LayoutDirection)

Modifies constraints for performing measurement of the modified layout element.

Inherited functions

Public methods

modifyConstraints

fun Density.modifyConstraints(
    constraints: Constraints,
    layoutDirection: LayoutDirection
): Constraints

Modifies constraints for performing measurement of the modified layout element.