Reputation: 1812
I am displaying of my HTML code in my textview and using html.fromhtml(). However, when comes to display h1 tag. It must have empty line after h1. I try to fix it by adding . But I understand that html.fromhtml() does not support class. May I know is it any solution to remove empty line after h1 in html.fromhtml()? The following is my sample code
title="<h1>Human Resource</h1>";
textView.setText(Html.fromHtml(title));
Upvotes: 1
Views: 526
Reputation: 4681
There will always be a blank space after < h1 > tags. Just like using < p > tags.
You could replace < h1 > tag programically:
title="<h1>Human Resource</h1>";
title = title.replace("<h1>", "<b>");
title = title.replace("</h1>", </b></br>");
textView.setText(Html.fromHtml(title));
Upvotes: 1