1

I want to create a list of three boxes arranged in a LazyColumn. The height of the boxes should take up all the available space within the parent.

So if the parent has the height of 90dp and the bottom padding of the boxes is 5dp then the height of each box should automatically get calculated to be 25dp.

How to do this?

Note: I tried modifier.fillMaxHeight(), which doesn't seem to work for LazyColumn and modifier.fillParentMaxHeight(1/3f), which does not include space for padding

Loma Harshana
  • 493
  • 1
  • 3
  • 6
  • I solved about the same problem [here](https://stackoverflow.com/a/70981692/3585796). – Phil Dukhov Mar 10 '22 at 12:29
  • The idea of including Spacer in the parent and setting parent size to a fraction of the container was brilliant! Thank you. If you could put this in answer, I would mark the question as answered. – Loma Harshana Mar 11 '22 at 01:49
  • I marked this as a duplicate because the solution is essentially the same for `LazyColumn` and `LazyRow`. Still don't delete it, as people will be able to find the duplication link through your question. – Phil Dukhov Mar 11 '22 at 05:31

0 Answers0