mTextView.setText(Html.fromHtml("26<ruby>日<rt>にち</rt></ruby>から"));
But Html.fromHtml doesn't support ruby element well. <rt> elements will be omitted in the textview. Is there any workaround? I have a list of such TextView, so WebView is inefficient.
Edit: I tried WebView, and it worked better than I thought. Be careful with encodings.
Android seems support the following HTML tags to be rendered on TextView.
<a href=”…”> <b>, <big>, <blockquote>, <br>, <cite>, <dfn>
<div align=”…”>, <em>, <font size=”…” color=”…” face=”…”>
<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
<i>, <img src=”…”>, <p>, <small>
<strike>, <strong>, <sub>, <sup>, <tt>, <u>
So ruby tag is not supported in here .
ruby -NOIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With