Basic question: I want a column half width against the right side of the view/parent. The fillMaxWidth(0.5f) is perfect for the width, but there is no offsetMaxWidth and the offset(x = ) expects dp. What is the simplest way to calc the offset or have it start in the middle? Thanks!
a
Adam Powell
06/10/2021, 5:00 PM
It sounds like you don't necessarily want a raw offset, you want to fill the entire available width but center the content within that space while only consuming half of it:
Copy code
Modifier.fillMaxWidth() // consume all available width
.wrapContentWidth() // wrap within the assigned max space; centers by default
.fillMaxWidth(0.5f) // fill half of the max
other params to
wrapContentWidth
can align it within the larger space any way you'd like. (start, center, end, etc.)
c
Casey Brooks
06/10/2021, 5:03 PM
It might be clearer if you wrap it in a row with multiple columns, each with
Thank you all. The Row solution won. if i need it on the right, I add a column to the left. if i need it on the left, i add a column to the right. otherwise, just a single fullmax column. thanks again. note this is part of a scrollable column, so i need to position in a kind of absolute way.