https://kotlinlang.org logo
Title
l

Lilly

04/11/2022, 10:46 AM
Is there a modifier to set a width for every child in a
Column
?
c

Christoph Wiesner

04/11/2022, 12:03 PM
why not set the width of the column to that size and make the children have
fillMaxWidth()
?
3
c

Chris Sinco [G]

04/11/2022, 2:33 PM
Also, by default children are sized to content width, so they already are set to specific widths implicitly. The overall Column width will be the width of the longest child. Adding modifiers on the Column (parent) or individual children will change this of course.
l

Lilly

04/11/2022, 4:36 PM
@Christoph Wiesner @Chris Sinco [G] Yeah sure. I have 10 children...I was looking for a central modifier to avoid applying a modifier to every children. Then I will apply
fillmaxWidth(fraction = 0.8f)
to all childs. Just hoped there is a lazy solution which I'm not aware of yet 😅 Thanks guys
c

Chris Sinco [G]

04/11/2022, 4:50 PM
Well Modifiers can be stored in variables so that is one “lazy” approach 🙂
l

Lilly

04/12/2022, 8:32 AM
Good point. Thanks Chris 🙂