Solution 1 :
Price text should be SpannableString
I would recommend you to modify your code adding this lines:
val priceTxt = SpannableString("10.000")
priceTxt.setSpan(StyleSpan(Typeface.BOLD), 0, priceTxt.length)
and
.append(priceTxt)
to your builder
Problem :
I want to have a string Bold into a textView with Kotlin, here’s my code :
val priceTxt = "10.000" ///example
val s = SpannableStringBuilder()
.append("starting from")
.append(" ")
.append(currency)
.append(" ")
.bold { append(priceTxt) }
txtviewPrice.text = s
I want to get the following result : “starting from $ 10.000″
What should I change in my code to make it as the example above ?
Comments
Comment posted by how to make a specific text on TextView BOLD
Does this answer your question?
Comment posted by How to set TextView textStyle such as bold, italic
Does this answer your question?