Вопрос

I am trying to store two carriage returns in in strings.xml but can't figure out why they are ignored. However, if I put them directly into the layout, the carriage returns work fine.

Outputs carriage returns
android:text="

Sent from my wonderful Android device"

Does not output carriage returns
<string name="sent_from">&#xA;&#xA;Sent from my wonderful Android device</string>

Это было полезно?

Решение

Try the following:

<string name="sent_from">\n\nSent from my wonderful Android device</string>

I think that is what you are looking for.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top