当我在
之间添加许多段落时<string name="bbb"> ...... </string>
它向我显示了以下错误。
[2014-12-22 14:54:55 - Inspiration] Her father rescued her from the heartless husband and she was back her to the
[2014-12-22 14:54:55 - Inspiration] G:\adt-bundle-windows-x86_64-20140702\workspace\Inspiration\res\layout\activity_women.xml:11: error: Error: No resource found that matches the given name (at 'text' with value '@string/Women1').
答案 0 :(得分:5)
试试这个
<string name="Your string name" > This is your string.
This is the second line of your string.\n\n Third line of your string.</string>
这将导致TextView上的以下内容:
This is your string.
This is the second line of your string.
Third line of your string.
答案 1 :(得分:1)
您可以将长字符串添加到/res/values/strings.xml,就像您已经完成的那样。
您可以使用\n
。
您需要对反斜杠等特殊字符使用Unicode代码。请参阅this answer
。
是的,只是要添加其他答案中的内容:另一个技巧是使用CDATA技巧:
<![CDATA[Foo Bar <a href="foo?id=%s">baz</a> is cool]]>