EditText不支持android中的HTML字体大小标记

时间:2016-01-19 11:39:44

标签: android html android-edittext

这是我的HTML screenshot 当我在edittext上设置它时,它不会增加edittext字体大小。

edittext.setText(Html.fromHtml()) 

任何想法?

1 个答案:

答案 0 :(得分:0)

使用其他选项设置edittext参数。

此外,请勿使用<p>进行设置。 只支持几个标记:

<a href="...">
<b>
<big>
<blockquote>
<br>
<cite>
<dfn>
<div align="...">
<em>
<font  color="..." face="...">
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<i>
<img src="...">
<p>
<small>
<strike>
<strong>
<sub>
<sup>
<tt>
<u>

顺便说一下,你可以使用类似的东西:

EditText et = new EditText(this);
et.setText(Html.fromHtml("Simple Text <B>Formatted Text</B> Simple Text Again"));

但这很丑:)