Change word color in resource string

前端 未结 4 1576
暖寄归人
暖寄归人 2020-12-01 19:16

Is there anyway to set the color of a string resource in android? I mean, I know I can use some html tags to change string style (or substrings) but have not found any to ch

4条回答
  •  渐次进展
    2020-12-01 19:36

    The strings themselves have no color, but you can change the color of the text in the textView they appear in. See the textview documentation, but there are 2 ways to do it.

    XML

    android:textColor
    

    Code

    setTextColor(int)
    

提交回复
热议问题