https://kotlinlang.org logo
#compose
Title
# compose
g

galex

07/17/2020, 3:44 PM
I have a Row I and in it I would like a Text() at its Start and another Text at its aligned to the end, how do I achieve that? Is there some documentation on alignments of that sort?
Managed!
Copy code
Row(horizontalArrangement = Arrangement.End) {
        Text(stringResource(id = field.label), modifier = Modifier.weight(1f))
        Text(
            text = field.startingValue.toString()
        )
    }
a

Adam Powell

07/17/2020, 4:09 PM
That'll do it 🙂 You could also add a
Spacer(Modifier.weight(1f))
between them if you prefer that mental model.
g

galex

07/18/2020, 3:58 AM
Thanks Adam, sounds better than my solution 🙂
a

Adam Powell

07/18/2020, 4:23 AM
Well, yes and no. Technically speaking having fewer layout nodes is cheaper, but in a case this focused it's probably negligible.
Serious hair splitting here 🙂