wrapContentSize
Compose Modifier
Common
fun Modifier.wrapContentSize(align: Alignment = Alignment.Center, unbounded: Boolean = false) =
this.then(
if (align == Alignment.Center && !unbounded) {
WrapContentSizeCenter
} else if (align == Alignment.TopStart && !unbounded) {
WrapContentSizeTopStart
} else {
WrapContentElement.size(align, unbounded)
}
)
Allow the content to measure at its desired size without regard for the incoming measurement
minimum width
or minimum height
constraints,
and, if unbounded
is true, also without regard for the incoming maximum constraints. If the
content's measured size is smaller than the minimum size constraint, align
it within that
minimum sized space. If the content's measured size is larger than the maximum size constraint
(only possible when unbounded
is true), align
within the maximum space.