我试图在EditText控件中呈现一个html字符串。粗体,斜体和下划线html可以正确呈现,但是穿透只会被忽略。罢工HTML标记不在EditText中使用TextFormatted呈现
这里是EditText上控制,没有任何幻想:
<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" />
这里是设置在HTML中的EditText控件的代码:
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);
这里是怎么了显示器的屏幕截图,请注意通过测试的方法无效。
任何想法我做错了吗?
正是由于这个代码的未来用户。在这种情况下,Object是Java.Lang.Object。 – Cheesebaron