Skip to content
🤔 Documentation issue? Report or edit

Row

A Row will show each child next to the previous children. It’s similar to a LinearLayout with a horizontal orientation.

@Composable
fun RowExample() {
    Row {
        Text("Hello World!")
        Text("Hello World!2")
    }
}

How to align row childrens with equal width

@Composable
fun RowExample() {
    Row(horizontalArrangement = Arrangement.SpaceEvenly) {
        Text("Hello World!")
        Text("Hello World!2")
    }
}

Row takes an horizontalArrangement parameter. When you set it to Arrangement.SpaceEvenly, the children of Row will equal a width.

How to align row childrens in center

@Composable
fun RowExample() {
    Row(horizontalArrangement = Arrangement.Center) {
        Text("Hello World!")
        Text("Hello World!2")
    }
}
Row takes an Arrangement parameter. When you set it to Arrangement.Center, the children of Row will be aligned in the center of Row.

How to align row childrens at end

@Composable
fun RowExample() {
    Row(horizontalArrangement = Arrangement.End) {
        Text("Hello World!")
        Text("Hello World!2")
    }
}
Row takes an Arrangement parameter. When you set it to Arrangement.End, the children of Row will be aligned at the end of Row.

See also:


Last update: September 1, 2021
Back to top