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
In this blog 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?
You can use use <small> for smaller text and so on.
Adding fonts to a TextView To set a font for the TextView , do one of the following: In the layout XML file, set the fontFamily attribute to the font file you want to access. Open the Properties window to set the font for the 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.
If 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