Component - Modifier basics (padding, size, clickable)
This UI component shows a simple box with padding, a fixed size, and a clickable behavior. It demonstrates how to add space inside the box, set its width and height, and respond to taps.
This UI component shows a simple box with padding, a fixed size, and a clickable behavior. It demonstrates how to add space inside the box, set its width and height, and respond to taps.
Box
└── Modifier (padding, size, clickable)
└── Textpadding modifier do in Jetpack Compose?Box(
Modifier.size(100.dp).padding(20.dp).clickable { /* do something */ }
) {
Text("Click me")
}Text(
"Tap me",
Modifier.clickable { println("Clicked") }.padding(10.dp)
)Pass the test and this pattern moves unknown