Luke
06/02/2022, 7:53 PMText
that I think might be a bug in the framework. Basically, when I put a height(x.dp)
modifier on a Text
, but the text is too long, the last line appears outside the bounds of Text
. More in thread.Activity
, the UI looks like this:
Column(
modifier = Modifier.fillMaxSize()
) {
Text(
text = "Super long lorem ipsum",
fontSize = 24.sp,
modifier = Modifier.fillMaxWidth()
.height(96.dp)
.background(Color.Red),
overflow = TextOverflow.Ellipsis,
)
Text(
text = "Some other text",
modifier = Modifier.fillMaxWidth(),
overflow = TextOverflow.Ellipsis,
)
}
Landry Norris
06/02/2022, 8:50 PMLuke
06/02/2022, 8:56 PMStylianos Gakis
06/02/2022, 9:49 PMLandry Norris
06/03/2022, 12:12 AMAleon Q
06/03/2022, 7:37 AMText
with fixed height, long text and overflow mode set to Ellipsis
behaves as if the overflow mode is set to Visible
and ignores Ellipsis
.
Workaround for me was to use maxLines
with Ellipsis
. That got me the result I was expecting with ellipsis.Siyamed
06/03/2022, 7:22 PM