zsperske
01/09/2023, 10:13 PMRow(modifier = Modifier.fillMaxWidth().padding(8.dp),
verticalAlignment = CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween) {
Text(modifier = Modifier.defaultMinSize(minWidth = 100.dp), text = "Some text that gets really long and keeps going and going", overflow = TextOverflow.Ellipsis, maxLines = 1)
Text(modifier = Modifier.defaultMinSize(minWidth = 100.dp), text = "Other text that gets really long", overflow = TextOverflow.Ellipsis, maxLines = 1)
}
Francesc
01/09/2023, 10:26 PMweight
and textAlign
for the 2nd one. If you need something fancier that takes into account the actual length of each text you may need to look at Layout
Row(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
verticalAlignment = CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Text(
modifier = Modifier.defaultMinSize(minWidth = 100.dp).weight(1f),
text = "Some text that gets really long and keeps going and going",
overflow = TextOverflow.Ellipsis,
maxLines = 1,
)
Text(
modifier = Modifier.defaultMinSize(minWidth = 100.dp).weight(1f),
text = "Other text that gets really long",
overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.End,
maxLines = 1,
)
}
zsperske
01/09/2023, 10:42 PMzsperske
01/09/2023, 11:38 PMFrancesc
01/09/2023, 11:59 PMLayout
and intrinsic measurementsLoney Chou
01/10/2023, 2:42 AMText
doesn't mean the first Text
will consider that, because when the second one gets measured the size of the first one is already decided. You need a custom Layout
.steelahhh
01/10/2023, 5:09 AMzsperske
01/10/2023, 5:36 PM