https://kotlinlang.org logo
#compose
Title
# compose
a

alorma

01/07/2021, 2:26 PM
Hi. How can add bold to a part of a text? (the
@nosferatu95
part
v

Vitor Prado

01/07/2021, 2:40 PM
you should use the “annotatedString”:
Copy code
Text(
 buildAnnotatedString {
  pushStyle(SpanStyle(fontWeight = FontWeight.Bold))
  append("@${userName} ")
  pop()
  append(yourString)
 }
)
a

alorma

01/07/2021, 3:00 PM
nice, thanks
🙌 1
s

Siyamed

01/09/2021, 5:09 AM
You can use withStyle which is a shortcut for push/pop
🙌 1