Member-only story

Android — How to use Weights in Jetpack Compose

Example Code — How to use Weights in Jetpack Compose

--

With 1.0.x you can use the Modifier.weight
Something like:

Row() {
Column(
Modifier.weight(1f).background(Blue)){
Text(text = "Weight = 1", color = Color.White)
}
Column(
Modifier.weight(2f).background(Yellow)
) {
Text(text = "Weight = 2")
}
}

--

--

Flutter Developer
Flutter Developer

Written by Flutter Developer

Flutter and Native Android developer

No responses yet