Is there a modifier for maxWidth? Cannot see it. L...
# compose
m
Is there a modifier for maxWidth? Cannot see it. Looking for a wrapContent with percentage max.
fillMaxWidth(X).wrapContentWidth
is not working for me
n
can you clarify "wrapContent with percentage max" ?
assuming I have a Box, 400.dp width, and an image in it with a 40.dp width. What do you want ?
m
The idea is to have the max width of the box. Let’s say we’ve got a 400.dp screen. I want to declare max width for a container (i.e. 0.8f) and show an image in it. Result: • large image - will take only 80% of width • small image - width will be set as wrap content
So it’s like a
sizeIn
with
wrapContentWidth
min and
fillMaxWidth(X)
as max
r
can u place both images inside row, give large image
weight
1f
and small image
Copy code
fillMaxWidth(0.20f)
You can use this plugin to visualize row/column arrangment
m
Thanks for suggestion, but it’s more like a workaround. I remember that
fillMaxWidth(X).wrapContentSize
worked before…
c
Do you have a code snippet of what worked before?
m
Was looking in the old source, but cannot find it