androidx.compose.foundation.layout
size
Function · from org.jetbrains.compose.foundation:foundation-layout:1.12.2
No hand-written docs yet.
Declare the preferred size of the content to be exactly sizedp square. The incoming measurement Constraints may override this value, forcing the content to be either smaller or larger.
Form 1
fun Modifier.size(size: Dp)
size: DpRequired
size: DpRequiredNot described.
With width, height
fun Modifier.size(width: Dp, height: Dp)
width: DpRequired
width: DpRequiredNot described.
height: DpRequired
height: DpRequiredNot described.
Form 3
fun Modifier.size(size: DpSize)
size: DpSizeRequired
size: DpSizeRequiredNot described.
Library docs
Declare the preferred size of the content to be exactly sizedp square. The incoming measurement
Constraints may override this value, forcing the content to be either smaller or larger.
For a modifier that sets the size of the content regardless of the incoming constraints, see
Modifier.requiredSize. See width or height to set width or height alone. See widthIn,
heightIn or sizeIn to set a preferred size range.
Example usage: