allan.conda
07/20/2021, 10:32 AMDominaezzz
07/20/2021, 11:14 AMMihai Popa
07/20/2021, 12:27 PMRow(Modifier.width(IntrinsicSize.Max)) {
Box1(Modifier.weight(1f))
Box2(Modifier.weight(1f))
}
dbaelz
07/20/2021, 12:54 PMpropagateMinConstraints = true
in the Boxes it should work.Box(
modifier = Modifier.fillMaxSize().background(Color.Yellow),
contentAlignment = Alignment.Center
) {
Row(
Modifier.width(IntrinsicSize.Max).fillMaxHeight()
) {
Box(
modifier = Modifier.fillMaxHeight().weight(1f).background(Color.Green)
) {
Text(text = "Short")
}
Spacer(Modifier.width(16.dp))
Box(
modifier = Modifier.fillMaxHeight().weight(1f).background(Color.Blue)
) {
Text(text = "Long Box")
}
}
}
allan.conda
07/20/2021, 3:08 PMIntrinsicSize.Max
but didn’t think that would work. Would you mind explaining how this code works?
Weight is relative to siblings and the maximum width.
I don’t understand where IntrinsicSize.Max bases the size from.
Anyway, let me try this. 😄
Edit: Works! Thanks