Component - Box layout
The Box layout in Android using Kotlin arranges child views by stacking them on top of each other. It is useful when you want to overlay views or place one view inside another, like putting text over an image.
The Box layout in Android using Kotlin arranges child views by stacking them on top of each other. It is useful when you want to overlay views or place one view inside another, like putting text over an image.
FrameLayout ├── ImageView └── TextView
Box layout in Android Kotlin Compose?Box in Jetpack Compose?Box(modifier = Modifier.size(100.dp)) {
Text("A", Modifier.align(Alignment.TopStart))
Text("B", Modifier.align(Alignment.Center))
Text("C", Modifier.align(Alignment.BottomEnd))
}Box {
Text("Hello")
Text("World", Modifier.align(Alignment.Center))
Text("!", Modifier.align(Alignment.Center))
}Pass the test and this pattern moves unknown