How do I get proper `fillMaxWidth` inside sth with...
# compose
m
How do I get proper
fillMaxWidth
inside sth with `horizontalScroll`(by default it is ignored)? I simply want the background to span all available width.
z
If you use a lazy row, you can use
fillMaxParentWidth
(docs), otherwise you could use
BoxWithConstraints
to get the available max constraints before the scrollable.
m
So with `BoxWithConstraints`I would measure the space, inside it use a scrollable, inside it use the max constraint as a width? Might not work if there is a padding applied along the way but will try.
z
Yea, if you have a more complex layout it might be better to just use a custom layout and make your own
fillMaxParentWidth
-like modifier
c
Also it seems you are wanting to build a Pager/Carousel with the LazyRow? You might want to check out the Accompanist Pager as well: https://google.github.io/accompanist/pager/
m
Thanks but not, I have a tree view over a `Column`(and so I want each node to highlight at full width when selected, just like in IJ) and then it's actually CfD
c
Ah I see I misunderstood 🤦
Have you posted a similar question in #compose-desktop?
m
Even if so it must have been long ago cause I don't remember doing that 🙂