Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Horizontal Arrangement not working in Jetpack Compose Row

I follow the official document to learn about Rows.

It's working fine. It arrange views horizontally and application runs without any issues.

Problem:

I want to set horizontalArrangement in Row. It didn't arrange it.

My code:

@Composable
fun SimpleRowArrangement(){
    Row(horizontalArrangement  =  Arrangement.SpaceEvenly,
            verticalAlignment = Alignment.Bottom) {
        Text(text = "Row Text 1")
        Text(text = "Row Text 2")
        Text(text = "Row Text 3")
    }
}

Output: enter image description here

like image 208
Ranjithkumar Avatar asked Dec 20 '25 18:12

Ranjithkumar


1 Answers

You should apply also the fillMaxWidth modifier.

Row(
    modifier = Modifier.fillMaxWidth(),
    horizontalArrangement = Arrangement.SpaceEvenly,
    verticalAlignment = Alignment.Bottom
) {
        Text(text = "Row Text 1")
        Text(text = "Row Text 2")
        Text(text = "Row Text 3")
    }

enter image description here

like image 59
Gabriele Mariotti Avatar answered Dec 23 '25 06:12

Gabriele Mariotti