Android TextView HTML字体大小标签 [英] Android textview html font size tag
问题描述
我在android textview中像这样使用<font size ="50">
标记
I use <font size ="50">
tag in android textview like this
resultTextView.setText(Html.fromHtml("<font size='50' color='#337744'>Text Message</font>"));
resultTextView.setText(Html.fromHtml("<font size=\"50\" color='#337744'>Text Message</font>"));
但问题是颜色标签有效,但尺寸标签无效
but the problem is the color tag works but size tag doesn't work
在此博客中 http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html
假定字体大小标签有效.我的代码有什么问题?
it is given that font size tag works. What's wrong in my code?
推荐答案
有确切的问题使用HTML尺寸TextView中的属性
.它说它忽略了大小.您可以将use <small>
用于较小的文本,依此类推. <font>
仅支持颜色和面部属性.参见 android.text.Html (在GrepCode上)和
如何在在Android或Java中呈现HTML代码和具有不同textSize的TextView 的更多信息.
希望它能有所帮助.
There is exact question Using size HTML attribute in TextView
. It says it ignores the size. You can use use <small>
for smaller text and so on. <font>
only supports color and face attributes. see android.text.Html (on GrepCode) and
How to apply font size while rendering HTML code in Android or Java and TextView with different textSize for more.
Hope it helps in someway.
这篇关于Android TextView HTML字体大小标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!