如何更改侧文字大小的android文本视图? [英] How to change the text size in side the text view in android?

查看:135
本文介绍了如何更改侧文字大小的android文本视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的TextView里面,我要改变文本的文字大小的文字中间像下面

I have textview inside that i want to change the text size of text in middle of the text like below

推荐答案

//使用 Html.fromHtml(STR)

String str="<font size =\"20\"><B>Bold</B> <br/> Then Normal Text<br/>
                         <i>Then Italic</i> </font>" +
                       "<br/> <font color=\"green\" >this is simple sentence </font>" +
                       "<br/> <font face=\"verdana\" >this is simple sentence </font>"+
                       "<br/><br/><br/><br/><a>this is simple sentence</a>";
      Spanned strHtml= Html.fromHtml(str);

       TextView tv = (TextView)findViewById(R.id.textView);
       tv.setText(strHtml);

也可以使用

SpannableString

这篇关于如何更改侧文字大小的android文本视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆