0

I have the following string:

☑ REKT

☑ Really Rekt

☑ Tyrannosaurus Rekt

I copy and pasted this into the strings.xml file but when it is displayed on screen it ends up looking like a jumbled mess.

enter image description here

How can I format this in strings.xml so it maintains its original list look.

(Ignore the hand at the beginning, that was from something else).

Update:

Doing ☑ REKT \n ☑ Really Rekt ☑ \n Tyrannosaurus Rekt \n produced this result:

enter image description here

Update Two: It seems to be a problem with the checkboxes. When I removed them the string acted fine. Unfortunately, I need the checkboxes.

Foobar
  • 7,458
  • 16
  • 81
  • 161
  • 1
    Are you asking [how to have tabs and newlines in a string resource](http://stackoverflow.com/a/14091780/115145)? – CommonsWare Apr 24 '16 at 20:47
  • @CommonsWare No, I tried using the traditional newlines method but it just produced a odd result. – Foobar Apr 24 '16 at 20:56
  • 1
    Perhaps your problem is not in the string resource, but in how you are applying it (e.g., gravity in the `TextView`). – CommonsWare Apr 24 '16 at 20:59
  • @CommonsWare I am making a custom keyboard, so I can't set any gravity. When a key is pressed on the keyboard the following code runs: `getCurrentInputConnection().commitText(inputText,1);` where `inputText` is the string. – Foobar Apr 24 '16 at 21:01
  • The app that has the `EditText` (or whatever is using the keyboard) will do what it wants with your text. You do not control that. At most, you control your keyboard itself. – CommonsWare Apr 24 '16 at 21:04
  • I just tried it and it worked fine for me with the newline characters. I displayed it in a TextView inside RelativeLayout. I realize I am quite late, but for examples like this one you need to provide more context for people to be able to help you in the future. – Megakoresh Jul 27 '16 at 07:21

1 Answers1

0

☑ REKT\n☑ Really Rekt\n☑ Tyrannosaurus Rekt

Adding line breaks should work

MDubzem
  • 109
  • 10