How can i set maxWidth in %age?
# compose
v
How can i set maxWidth in %age?
s
I don't think you can. You can use
.weight
to get a percentage.
You can use
BoxWithConstraints
or
Layout
also, if you want more control over your content size.
👎🏾 1
z
Copy code
Modifier.fillMaxWidth(fraction = TODO())
v
@Zach Klippenstein (he/him) [MOD] I meant MaxHeight using
widthIn()
but max value is a %age
@Sean Proctor Thanks, I'll give it a try
s
Percentage of what? If it's height why not fillMaxHeight(%age)
v
Wont fillMaxHeight/fillMaxWidth occupy the %age i pass even if the content is smaller than that I want it to grow at max to that %age of height/width
s
Try doing fillMaxSize which will make the layout take that much height, and after it do wrapContentHeight, so that it will shrink to take the amount it actually needs. I'd try something like that myself