Function

weight

Size the element proportional to its weight relative to other weighted sibling elements in the container (this will be the height in a curvedColumn and the width in a curvedRow).

weight

Source set: Android
public fun CurvedModifier.weight(
    @FloatRange(from = 0.0, fromInclusive = false) weight: Float
): CurvedModifier

Size the element proportional to its weight relative to other weighted sibling elements in the container (this will be the height in a curvedColumn and the width in a curvedRow). The parent will divide the space remaining after measuring unweighted child elements and distribute it according to this weight.

Example usage:

Parameters

weight The proportional size to give to this element, as related to the total of all weighted siblings. Must be positive.
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: