I wanted to put this text more organized without having to create several textview, and I had the idea of using line break.
Use the escape character \n
:
android:text="linha1\nlinha2\nlinha3"
You can add HTML tags to a text of your strings.html
follows an example:
strings.html
<string name="minha_receita_1"> <![CDATA[ <ul> <li>1 caneca ou bule</li> <li>1 garrafa térmica</li> <li>1 colher (sopa)</li> <li> 1 coador de café</li> </ul> ]]> </string>
Content html
should be between <![CDATA[ ]]>
In Java, do the following:
TextView textHtml = TextView.class.cast(convertView.findViewById(R.id.receita));
final Spanned textoEmHtml = Html.fromHtml( getContext().getString(R.string.minha_receita_1));
textHtml.setText(textoEmHtml);