← Back to Foundation Layout
preferredWidth
Modifier
in
Foundation Layout
. Since 0.1.0-dev15Overview
Examples
Community Notes
Declare the preferred width of the content to be the same as the min or max intrinsic width of the content. The incoming measurement Constraints may override this value, forcing the content to be either smaller or larger.
See preferredHeight for options of sizing to intrinsic height. Also see preferredWidth and preferredWidthIn for other options to set the preferred width.
Overloads
preferredWidth
@ExperimentalLayout
fun Modifier.preferredWidth(intrinsicSize: IntrinsicSize)
preferredWidth
fun Modifier.preferredWidth(width: Dp)
Next ComponentAlignmentLineOffset →