Does anyone know whether it's possible to make a ScrollableTabRow only take the amount of width it actually needs? I'd like to horizontally center a ScrollableTabRow but it seems to take up more width than it actually needs to show the amount of tabs I'm providing it, meaning it looks offset from the center
p
Peter
09/14/2023, 12:27 PM
if you set
weight(1f)
to your children, is that ok?
t
Tom De Decker
09/14/2023, 12:28 PM
ScrollableTabRow doesn't seem to expose a RowScope for the content so I don't think I can actually do this
🙈 1
p
Peter
09/14/2023, 12:40 PM
what about using
TabRow
?
t
Tom De Decker
09/14/2023, 12:41 PM
All items in a TabRow have an equal proportion of the width while I actually need each item to take as much as they need (and have the overflow be scrollable)
Tom De Decker
09/15/2023, 9:09 AM
I've noticed that I can copy the ScrollableTabRow code and only remove the
fillMaxWidth
on the
SubcomposeLayout
to make it work like I expected (not take up more width than it needs). Is this something I can file an issue for or is this expected behavior?
Tom De Decker
09/15/2023, 9:10 AM
Worst case we'll have to copy the code and manually try to keep it in sync with the material3's version, but I'd rather avoid this if possible.