Has anyone been able to successfully use FlowRow a...
# compose-android
c
Has anyone been able to successfully use FlowRow and alignment? Seems like it's not possible to vertically center items in a flow row due to FlowRowScopeInstance being private.
r
Are you not able to use
Modifier.align(Alignment.Center)
?
c
Seems not?
2023-05-25 at 09.48.36.png
I'm using 1.5.0-beta01 from yest
If I try Center then I get this
f
you are applying the
Alignment
to the
FlowRow
which implies its parent must be a
Box
- is that the case? You can apply
Alignment
to the children of
FlowRow
c
Interesting. I basically have Text, Icon, Icon, Icon, Icon, Icon, Icon, Icon and the text is not in line with the icons... so lets see if that works. lol I'll just set the alignment on the text? That should do?
f
let me change one to a Text
r
Yeah you need to put the alignment modifier on the children
f
works the same regardless of the child
c
oh wow. so weird to me. ive been using compose for like 2 years. lol
and alignment of children was always possible from the parent i feel
like. if i just wanted every child to be centered vertically, then setting it on the layout makes sense to me.
but. if this lets me ship this feature... i will be soooo happy
AHH. that worked!
thank you all so much.
r
Yeah this changed from previous release due to not wanting to confuse verticalArrangement parameter with verticalAlignment parameter, so verticalAlignment was removed in favour of individual modifiers on each item.
c
intereseting. i read that release note... but it did not seem like individual modifiers on each item was required
880 Views