0

I want to add a \n to a button in the layout. I try the answers of this post : Write Multiline Text on Button in Android bc i think its the same problem, but no one of these answers works form me (i've tried add "&#10" and the \n in the strings.xml)

Its for an android app, API 23 or higher. My line:

<string name="main_btn_X">xxxx xx \n xxx xxxx</string>

2 Answers2

0

Just use &#10; instead of \n in xml

Sanjay Kushwah
  • 190
  • 1
  • 9
0

Try to use another "\" in front of "\n". This will bypass this actually functionality of "\n"

<string name="main_btn_X">xxxx xx \\n xxx xxxx</string>
Harv
  • 446
  • 5
  • 12
  • Nop, thats not works (it adds \n in the text literally). I solve this putting " " (bc I forgot the semicolon). Anyway, thanks for replying! :D – Miwell Joestar Jun 07 '19 at 17:48
  • But this solution worked for me. But I'm glad you got another solution, – Harv Jul 18 '19 at 09:37