I’ve got a Column, inside this Column are 2 other ...
# compose
a
I’ve got a Column, inside this Column are 2 other Columns. The first inner Column is Scrollable and the content height is higher than the screen height. How can i achieve that both inner Columns are still visible? Current situtation: first inner scrollable Column is visible, other Column is drawn outside the visible Area.
So basically imagine this: Column(modifier = Modifier.fillMaxSize()) { Column() { // Content that is scrollable and exceeds the viewport height } Column() { // Other content that has to be visible in any case } }
t
Try adding both inner col with
Modifier.weight(1f)
a
@Tin Tran Tried this. This leads to both columns fill 50% of the screen. What i have is a scrollable column with different contents in the first inner column and 2 Buttons in the second inner column. Obviously i want to have the second column wrapped with the height of the 2 buttons (weight 1f on both columns will give the second column a lot of whitespace)
t
You can try setting the second col with fixed height and remove the
weight
on both col
Or you can set the first col weight with 9f and second col with 1f
a
Only setting a weight on the first column should work.
a
Thank you everyone for you input! I’ve managed to solve this using compose ConstraintLayout
It seems that this is simply impossible using Columns
a
ContstraintLayout seems an overkill. Have you tried setting a weight on the first column?
a
I’ve tried this. Same results
z
I just tried this, and setting a weight for the first (scrolling) child column does work. I wonder if there was some other layout modifiers that were getting in the way?
👍 3
a
@Zach Klippenstein (he/him) [MOD] Sounds great! I stuck to the constraint layout solution though 🙂