How I can align two elements like that in Row()?
# compose
i
How I can align two elements like that in Row()?
a
Copy code
Row(){
Text("Label 1")
Spacer(Modifier.weight(1f))
Text("Label 2")
}
a
Better:
Copy code
Row(horizontalArrangement = Arrangement.SpaceBetween)
i
Doesn't work
a
Make sure you have
Modifier.fillMaxWidth()
on your Row
i
Second label is located higher than first and centered
a
Do you want the labels centered in height? then you can add in
Copy code
Row(verticalAlignment = Alignment.CenterVertically)
❤️ 1