How to make a new line or tab in XML (eclipse/android)?

前端 未结 8 964
感情败类
感情败类 2021-01-31 13:25

So, in my strings.xml I have a very long text which I want to format somehow. How can I put a tab before the first sentence of the text? Also, what is the code for new line? Tha

相关标签:
8条回答
  • 2021-01-31 13:50

    \n didn't work for me. So I used <br></br> HTML tag

        <string name="message_register_success">
    Sign up is complete. <br></br>
     Enjoy a new shopping life at MageMobile!!
    </string>
    
    0 讨论(0)
  • 2021-01-31 13:52

    Use \n for a line break and \t if you want to insert a tab.

    You can also use some XML tags for basic formatting: <b> for bold text, <i> for italics, and <u> for underlined text

    More info:

    https://developer.android.com/guide/topics/resources/string-resource.html

    0 讨论(0)
提交回复
热议问题