3

Converting html file to spanned object and displaying it in TextView works fine but what if I want to also apply css styles? I've tried to combine css styles with html file but styles ale ignored by Html.fromHtml() method.

How can I display text modified by css styles in my TextView?

2

1 Answer 1

3

what if I want to also apply css styles?

That is not supported by Html.fromHtml(). You will need to build your own HTML/CSS parser and build your own formatted string, perhaps using SpannableStringBuilder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.