【发布时间】:2020-09-02 08:33:14
【问题描述】:
我想用 Kotlin 将字符串 Bold 放入 textView,这是我的代码:
val priceTxt = "10.000" ///example
val s = SpannableStringBuilder()
.append("starting from")
.append(" ")
.append(currency)
.append(" ")
.bold { append(priceTxt) }
txtviewPrice.text = s
我想得到以下结果:"starting from $ 10.000"
我应该在我的代码中进行哪些更改以使其成为上面的示例?
【问题讨论】:
-
这能回答你的问题吗? how to make a specific text on TextView BOLD