Hi Everyone, can anyone help me i am not able to f...
# compose
n
Hi Everyone, can anyone help me i am not able to figure out how we can add asterisk in red colour as per Screenshot
m
I think that would work:
Copy code
val label = buildAnnotatedString {
    append("User Name")
    withStyle(SpanStyle(color = Color.Red)) {
        append(" *")
    }
}
1
c
Yep the above should work, but we sure to pass within a
Text
Composable into the
label
parameter which is a slot parameter:
Copy code
label = {
    Text(
        text = buildAnnotatedString {
            append("User Name")
            withStyle(SpanStyle(color = Color.Red)) {
                append(" *")
            }
        }
    )
},
n
Thanks @maciejciemiega @Chris Sinco [G]
👍 1