问题在改变一个字的颜色中的strings.xml [英] Issue in changing the color of a word in strings.xml
问题描述
我创建一个 AlertDialog
,其中有一个的TextView
,显示一些文本的布局。对于文本我在的strings.xml
在这里我想换一个字的颜色,就像下面的图片中的一个项目。
我想这个:
I created a layout for an AlertDialog
in which there's a TextView
that shows some text. For the text I have an item in strings.xml
where I would like to change the color of a single word, just like in the image below.
I tried with this:
<string name="dialog_text">Text... <font fgcolor="#000000">TheWordIWantInBlack</font> text text text.</string>
问题是,当我显示在对话框中的所有文本,除了在&LT字设备(银河注3)上运行此; FONT&GT;
标记,但在模拟器(Nexus 5的与Android 6.0)一切正常,到底我想要的。
你能帮助我吗?
The issue is when I run this on the device (Galaxy Note3) that shows all the text in the dialog except for the word in the <font>
tag but on the emulator (Nexus 5 with Android 6.0) everything is ok, exactly how I want it.
Could you help me?
推荐答案
在 fgcolor
替换#000000
与黑色
,像
<string name="dialog_text">Text... <font fgcolor="black">TheWordIWantInBlack</font> text text text.</string>
相对短名单上这仅适用于内置的颜色:浅绿色,黑色,蓝色,紫红色,绿色,灰色,灰,褐红色,深蓝色,橄榄,紫色,红色,银色,青色,白色,黄
这篇关于问题在改变一个字的颜色中的strings.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!