zalewski.se
04/02/2022, 2:30 PMAlbert Chang
04/02/2022, 4:48 PMBox(propagateMinConstraints = true) {}
Tobias Gronbach
04/04/2022, 12:19 AMAlbert Chang
04/04/2022, 12:24 AMModifier.fillMaxSize()
?zalewski.se
04/04/2022, 1:43 PMpropagateMinConstraints
and fillMaxSize
doesn’t really work for me
In my case, I would like to scale the view down to fit the container. So let’s assume the composable is just a Column()
with an image and some text below it, depending on the text value and font size (which can vary a lot with accessibility settings) this view can grow significantly. In case it get’s bigger than the container, I would like it to automatically scale down (adjusting just the text size is not ok as I would like to keep proper ratio between an image size and the text size).
Anyway I think I’m able to achieve it with
.aspectRatio(ratio)
.wrapContentHeight(unbounded = true)
.scale(scaleValue)
where proper scaleValue
I can calculate based on the container size and my view size