I'm just starting with Android jetpack compose and would like to place a button in a Box and have the button be 20% as wide as the width of the Box and have it be 50% of the width of the Box. In the old ContraintLayout, I could do this with layout_constraintGuide_percent.
You can set the width and height with respect to parent like this,
Button(modifier = Modifier.
fillMaxWidth(0.5f)) //50% width as the parent
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