fillMaxSize
Compose Modifier
Common
fun Modifier.fillMaxSize(@FloatRange(from = 0.0, to = 1.0) fraction: Float = 1f) =
this.then(if (fraction == 1f) FillWholeMaxSize else FillElement.size(fraction))
Have the content fill (possibly only partially) the Constraints.maxWidth
and
Constraints.maxHeight
of the incoming measurement constraints, by setting the
minimum width
and the maximum width
to be equal
to the maximum width
multiplied by fraction
, as well as the
minimum height
and the maximum height
to be
equal to the maximum height
multiplied by fraction
. Note that, by
default, the fraction
is 1, so the modifier will make the content fill the whole available
space. If the incoming maximum width or height is Constraints.Infinity
this modifier will have
no effect in that dimension.
Parameters
fraction | The fraction of the maximum size to use, between 0 and 1 , inclusive. |