I am attempting to render an html string within an EditText control. Bold, italic, and underline html renders correctly, however strike through is just ignored.
Here is the EditText control, nothing fancy:
<EditText
android:id="@+id/rich_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.EditText"
android:gravity="top"
android:inputType="textFilter|textMultiLine|textNoSuggestions"
android:minLines="8"
android:textStyle="normal" />
And here is the code that is setting the html in the EditText control:
var textView = view.FindViewById<EditText> (Resource.Id.rich_text);
var html = "<b>bold test</b> <u>underline test</u> <i>italic test</i> <strike>strike test 1</strike> <del>strike test 2</del> <s>strike test 3</s>";
textView.TextFormatted = Html.FromHtml (html);
Here is a screenshot of how it displays, notice how the strike through tests aren't working.
Any ideas what I'm doing wrong?
<strike>
is not supported. I can't find an official documentation with list of all supported HTML tags. However, if you look at the source code you won't find support there.https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/text/Html.java
What I can gather the following tags are supported:
Here is how I solved the issue. I created an implemented of ITagHandler:
This can be called like so:
And here is how it looks: