https://kotlinlang.org logo
v

Vipulyaara

02/27/2021, 3:13 PM
I am trying to justify a single line of text. I have tried appending
\n
with no help. The first line of text is justified if I set
maxLines = 2
and let the text flow in second line. I am not so familiar with how justification works on android but is there a way to achieve this - a single line of text which can stretch to occupy full width of the screen?
Copy code
ClickableText(
    modifier = modifier.fillMaxWidth(),
    text = annotatedString,
    style = MaterialTheme.typography.h6.copy(
        textAlign = TextAlign.Justify,
    ),
    maxLines = 1,
    onClick = {
        //
    },
)