I have a long text in my string resources containing multiple line breaks. obviously i don't want to write it all in one line like <string name="text">This is the first line\nThis is the second line\n...</string>
But when i do it like this:
<string name="text">
This is the first line\n
This is the second line\n
...
</string>
The start of the lines are indented a bit. How can i prevent this?
This is the first line
This is the second line
i set the text ´directly in xml with android:text="@string/text"
Remove the tabs when parsing ("\t") I think.
one simple way is use "" in your text string, such as like this:
<string name="text">
"This is the first line
This is the second line"
</string>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.