VisibleModifierSample
@Composable
fun VisibleModifierSample() {
Box {
// This box will not be visible but will still occupy 50.dp x 50.dp of space.
Box(modifier = Modifier.size(50.dp).background(Color.Red).visible(false))
}
}A Modifier that controls the visibility of the Layout it is applied to.
Compose Multiplatform
Ship iOS, desktop, and web apps with Compose
RevenueCat
Add subscriptions to your apps in minutes
@Composable
fun VisibleModifierSample() {
Box {
// This box will not be visible but will still occupy 50.dp x 50.dp of space.
Box(modifier = Modifier.size(50.dp).background(Color.Red).visible(false))
}
}Last updated: