TextView renders ugly bullets for <li> tags

209 views Asked by At

We have the next input String:

String test = "<li>Some text</li>\n" +
              "<li>Some text</li>\n" +
              "<li>Some text</li>";


Then we create spanned via and set it into the TextView:

Html.fromHtml(test);

As a result, I will get ugly bullets like here enter image description here

I have found a not very good workaround to replace "li" blocks with unicode character:

String test = test.replaceAll("<li>(.*?)</li>", "<br>\u2022 $1");

The result will be as expected:

enter image description here

Maybe someone find more clear solution?

1

There are 1 answers

1
AudioBubble On

Try to set gravity as center_vertical for the textview. Hope this will help you in getting it as expected.