views:

77

answers:

1

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

+1  A: 

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.

methode
Thanks - that's what I discovered, too. Darn. Too bad it doesn't generate an error so it would be obvious. However, the \n did work! Which surprises me. I think I'll try out some of the other format things used in pure code. Thanks again!
headscratch