https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

10/11/2023, 5:56 PM
I feel like I'm going crazy. I have a
Copy code
Column(Modifier.fillMaxHeight){
  Text()
  Image(weight(1f))
  Text()
  Button { Text() }
}
and I would have thought all of the texts + button would show (they all have 1 line) and then with the rest of the available space, the image would fill it up. Currently it seems like the image is pushing all of the text off the bottom.
s

Stylianos Gakis

10/11/2023, 6:00 PM
Does it work the same if instead of image you just put Box?
c

Colton Idle

10/11/2023, 6:02 PM
Hm. I think I just had to size the image first, then give it a weight. I think maybe the image was just too big. 😥
resolved. just needed a rubber duck i guess. lol
s

Stylianos Gakis

10/11/2023, 6:05 PM
How was it resolved then? Weight normally takes 0 space if there is no space to be taken. And text and button should always show, even if the column height is low. Weight should also just take as much space as there is available, it shouldn't push the two items below outside of the column's height normally
c

Colton Idle

10/11/2023, 6:07 PM
I just added height before the weight modifier of the image
unless maybe my preview/apk wasn't updating properly? (thats always a possibility) I've filed like 3 bugs about that in the past few months. maybe it hit me again.
s

Stylianos Gakis

10/11/2023, 6:11 PM
Aha so it also had height before, unlike the snippet you posted here.
c

Colton Idle

10/12/2023, 1:27 AM
It did not. It only had a weight set. but once i added the height then things started working
s

Stylianos Gakis

10/12/2023, 7:12 AM
Right, and what I was wondering is that if it was not an
Image
but it was a normal
Box
, did it behave the same way?
c

Colton Idle

10/12/2023, 5:12 PM
Gotcha. I will try to check that out. moved onto the next thing already since we're rushing to ship for monday 😵
🚢 1