Function

requiredSizeIn

Constrain the size of the content to be between min and max dp, disregarding the incoming measurement VolumeConstraints.

requiredSizeIn

Source set: Android
public fun SubspaceModifier.requiredSizeIn(
    minWidth: Dp = Dp.Unspecified,
    maxWidth: Dp = Dp.Unspecified,
    minHeight: Dp = Dp.Unspecified,
    maxHeight: Dp = Dp.Unspecified,
    minDepth: Dp = Dp.Unspecified,
    maxDepth: Dp = Dp.Unspecified,
): SubspaceModifier

Constrain the size of the content to be between min and max dp, disregarding the incoming measurement VolumeConstraints.

This is in contrast to SubspaceModifier.sizeIn, which respects the parent's constraints. requiredSizeIn will ignore the min and max constraints from the incoming constraints, which can be useful for sizing an element to a specific range even if it exceeds the parent's bounds.

Parameters

minWidth The minimum width.
maxWidth The maximum width.
minHeight The minimum height.
maxHeight The maximum height.
minDepth The minimum depth.
maxDepth The maximum depth.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: