Reputation: 551
In my XML values strings code, I have a string with some text that I want to have only a few of the words in color. I also want to have a new line for some of the text.
I can do things like: < b> my bold text < /b> and that works (leading space added for this post).
I try to tag the text with color but no color shows up and there are no errors.
name="dogs"
>Red Dog, <color foreground="#FFFF0000"> Sammy</color></string>
I also try adding a new line - I've tried things like:
< LF> some text, space at beginning only for this post < /LF>
< CR> this didn't work either < /CR>
< p> some text, space at beginning only for this post < p>
But, no new paragraph / new line, carriage rtn happens.
What am I doing wrong? Or, more correctly put, How do I accomplish this?
Thanks
Upvotes: 0
Views: 3104
Reputation: 5438
As per the documentation, the three supported HTML tags for values in the strings.xml are (without fromHTML()):
<b>
<i>
<u>
As for a new line, you could try a bare \n
. I remember at least one folk reporting it worked.
Upvotes: 3