【发布时间】:2021-11-01 05:57:24
【问题描述】:
有没有办法改变 strings.xml 文件中的文本颜色,而不是使用 SpannableString?如果没有必要,我不想将代码放入我的片段中。
【问题讨论】:
有没有办法改变 strings.xml 文件中的文本颜色,而不是使用 SpannableString?如果没有必要,我不想将代码放入我的片段中。
【问题讨论】:
您可以在 strings.xml 文件中执行此操作,如下所示:
<string name:"your_string"> your text without color <font color = '#216db2'> your colored text</font> more text without color</string>
当然 #216db2 可以是你想要的任何颜色
【讨论】: