Hello, how can I create a modifier that has 4 cons...
# compose
d
Hello, how can I create a modifier that has 4 constraints: • Tries to fill max width • Has a horizontal padding • Has a max width Also the composable will be used inside a Column with a vertical scroll
1
I tried using
fillMaxWidth
with
sizeIn
but it didn't work, I'm not sure why, the composable will use the parent's width
v
What do you mean with "tries to fill max width"? Relative to what?
fillMaxWidth()
refers to the incoming constraints. It's working as intended when it fills the parent's width.
If you want to disregard the parent's max bounds you can use
wrapContentSize(unbounded = true)
to ignore incoming constraints.
a
Just put
sizeIn
before
fillMaxWidth
.
1
✔️ 2
v
Ah, I just understood what you were actually asking. I somehow missed the point of filling but still having a max 😅
d
Thanks, it worked