Nat Strangerweather
09/12/2020, 10:59 AMColumn(Modifier.fillMaxHeight()) {}
Why are the bottom squares no reaching the bottom of the screen? I have not put any padding.Yann Badoual
09/12/2020, 11:02 AMNat Strangerweather
09/12/2020, 11:03 AMYann Badoual
09/12/2020, 11:03 AMweight
modifier to achieve that. Setting the same weight on each childrenNat Strangerweather
09/12/2020, 11:03 AMYann Badoual
09/12/2020, 11:04 AMNat Strangerweather
09/12/2020, 11:04 AMMaterialTheme {
Column(Modifier.fillMaxHeight()) {
val modifier1 = Modifier
.fillMaxWidth()
.weight(1f)
val modifier = Modifier
.size(150.dp)
.weight(1f)
Row(modifier1) {
Box(modifier, backgroundColor = Color.Magenta)
Box(modifier, backgroundColor = Color.Cyan)
}
Row(modifier1) {
Box(modifier, backgroundColor = Color.Magenta)
Box(modifier, backgroundColor = Color.Cyan)
}
Row(modifier1) {
Box(modifier, backgroundColor = Color.Magenta)
Box(modifier, backgroundColor = Color.Cyan)
}
}
}
Yann Badoual
09/12/2020, 11:09 AMfillMaxHeight()
instead of size(150.dp)
=> you're manually setting the size to 150.dp, so the actual box is not stretching because of itNat Strangerweather
09/12/2020, 11:11 AMsante
09/12/2020, 12:52 PMColumn(
modifier = fillMaxHeight(),
verticalArrangement = Arrangement.SpaceBetween,
){
...
}
You have other options for arrangement like SpaceAround and SpaceEvenly. The option in the snippet makes it so that the contents of the column are spread from top to bottom, with the first element right at the top and the last one right at the end