RowScope

class RowScope : FlexScope
kotlin.Any
   ↳ androidx.ui.layout.FlexScope
   ↳ androidx.ui.layout.RowScope

A RowScope provides a scope for the children of a Row.

Summary

Public methods

LayoutModifier

A layout modifier within a Row that positions target component in a perpendicular direction according to the AlignmentLine.

Inherited functions

Properties

LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its bottom edge is aligned to the bottom edge of the vertical axis.

LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its center is in the middle of the vertical axis.

LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its top edge is aligned to the top edge of the vertical axis.

Inherited properties

Public methods

RelativeToSiblings

fun Gravity.RelativeToSiblings(alignmentLine: HorizontalAlignmentLine): LayoutModifier

A layout modifier within a Row that positions target component in a perpendicular direction according to the AlignmentLine. If target component is the only component within a Row with the specified RelativeToSiblings modifier, or if the provided alignment line is not defined for the component, the component will be positioned using Gravity.Top.

Example usage:

import androidx.ui.core.Text
import androidx.ui.layout.Container
import androidx.ui.layout.Row
import androidx.ui.text.TextStyle

Row(ExpandedHeight) {
    // Center of the colored rectangle is aligned to first baseline of the text.
    SizedRectangle(
        color = Color.Red,
        width = 80.dp,
        height = 40.dp,
        modifier = Gravity.RelativeToSiblings { it.height * 0.5 }
    )
    Container(width = 80.dp, modifier = Gravity.RelativeToSiblings(FirstBaseline)) {
        Text(text = "Text.", style = TextStyle(background = Color.Cyan))
    }
}

Properties

Bottom

val Gravity.Bottom: LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its bottom edge is aligned to the bottom edge of the vertical axis.

Center

val Gravity.Center: LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its center is in the middle of the vertical axis.

Top

val Gravity.Top: LayoutModifier

A layout modifier within a Row that positions target component in a vertical direction so that its top edge is aligned to the top edge of the vertical axis.