I am creating a simple counter app using jetpack compose and want , button to be placed in center of the layout , i tried using Modifier.gravity(Alignment.Center) , but its not providing any result , what should be the way to implement this ?
You can use something like:
Column(
modifier = Modifier.fillMaxWidth().fillMaxHeight(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Button(onClick = {})
{ Text("BUTTON") }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With