statusBarsHeight

fun Modifier.statusBarsHeight(additional: Dp = 0.dp): Modifier

Declare the height of the content to match the height of the status bars exactly.

This is very handy when used with Spacer to push content below the status bars:

Column {
Spacer(Modifier.statusBarHeight())

// Content to be drawn below status bars (y-axis)
}

It's also useful when used to draw a scrim which matches the status bars:

Spacer(
Modifier.statusBarHeight()
.fillMaxWidth()
.drawBackground(MaterialTheme.colors.background.copy(alpha = 0.3f)
)

Internally this matches the behavior of the Modifier.height modifier.

Parameters

additional

Any additional height to add to the status bars size.