fitOutside

Common

Modifier in Compose Foundation Layout

Last updated:

Installation

dependencies {
   implementation("androidx.compose.foundation:foundation-layout:1.9.0-alpha01")
}

Overloads


fun Modifier.fitOutside(rulers: RectRulers): Modifier

Code Example

FitInsideOutsideExample

@Composable
fun FitInsideOutsideExample() {
    Box(Modifier.fillMaxSize()) {
        // Drawn behind the status bar
        Box(Modifier.fillMaxSize().fitOutside(StatusBars).background(Color.Blue))
        // Drawn behind the navigation bar
        Box(Modifier.fillMaxSize().fitOutside(NavigationBars).background(Color.Red))
        // Body of the app
        Box(Modifier.fillMaxSize().fitInside(SafeContent).background(Color.Yellow))
    }
}
by @alexstyl