ivan ivan - 7 months ago 41
Android Question

How to change text background inside in xml

Let say I have next code in strings XML, which is working fine and text color become blue on output

<string name="hello_world">
<font color='blue'> Hello world!</font> here is my text with yellow background

Question - Is it possible to change text background for some worlds in similar way as above, directly inside in xml string ?

Final result:

enter image description here


Sure, Check this:

<string name="hello_world">
<font color='blue'> Hello world!</font><font color = 'black' bgcolor = 'yellow'> here is my text with yellow background</font>