Marcin Wisniowski
02/08/2022, 1:52 AMmaxLines = 5
on a Text
to limit it to 5 lines, but how do I make it always take the space of 5 lines, even if there is less text? I'm looking for a minLines = 5
, if there was one.Zun
02/08/2022, 9:29 AMMarcin Wisniowski
02/08/2022, 10:59 AM\n
. Would be nice to have a proper solution.Filip Wiesner
02/08/2022, 11:59 AMTextField
but in regular Text
you can use lineHeight of your font to specify height of the text:
maxLines = NumberOfLines,
modifier = modifier.height( // for min lines
with(LocalDensity.current) { MyTextStyle.lineHeight.toDp() * NumberOfLines }
)
It still feels like a hack but less than inserting \n
at the end of string 😄wintersoldier
02/08/2022, 12:10 PMMarcin Wisniowski
02/08/2022, 1:01 PM