0

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"

Ginso
  • 459
  • 17
  • 33

3 Answers3

0

Remove the tabs when parsing ("\t") I think.

0

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>
ninhnau19
  • 695
  • 1
  • 3
  • 16
0

I use usually something like this below:

Image

You can use this also for long texts. You have to write this without tabs or spaces, just from the begin of the line like the photo.

Edited: "br tag" is used for new line

Nader
  • 9
  • 3