Function

requiredWidth

Declare the size of the content to be exactly width dp along the x dimension, disregarding the incoming VolumeConstraints.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

requiredWidth

Android
public fun SubspaceModifier.requiredWidth(width: Dp): SubspaceModifier

Declare the size of the content to be exactly width dp along the x dimension, disregarding the incoming VolumeConstraints.

This is in contrast to SubspaceModifier.width, which respects the parent's constraints. requiredWidth will ignore the minWidth and maxWidth from the incoming constraints, which can be useful for sizing an element to a specific value even if it exceeds the parent's bounds.