Thread
#compose
    a

    Andreas Jost

    2 years ago
    Hi, if I use a Spacer in SwiftUI without a height argument, the spacer takes all available space. Is there an equivalent in Compose? So if I have a Column, that has the following subviews: "HeightSpacer, Text, HeightSpacer, Text, HeightSpacer" the HeightSpacers should equally take the remaining space automatically.
    Zsolt

    Zsolt

    2 years ago
    I guess you could use FlexColumn to achieve this instead of spacers
    Luca Nicoletti

    Luca Nicoletti

    2 years ago
    SpaceEvenly as an argument of alignment for the column, without even adding the spacers, will do the same
    a

    Andreas Jost

    2 years ago
    Alright, that works if you want only evenly spaced lines, that's great! But what if you needed something like "SpaceEvenly, Text, HeightSpacer(10.dp), Text, SpaceEvenly" (mixing fixed Spacers with Spacers, that should take the remaining spaces) Seems like you have to use nested Columns? That makes it more complicated than the SwiftUI approach imho, or do I miss something?
    Zsolt

    Zsolt

    2 years ago
    In that case you can have Column with Center alignment. In more advanced cases you can have FlexColumn.