2012-01-18 43 views

回答

2

//使用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

+0

感謝Padma Kumar.Really幫助我 – Krishna 2012-01-18 16:22:32

+0

然後你想要什麼Kumar – Krishna 2012-01-18 16:27:22

+0

文本大小在運行時沒有改變。 – Krishna 2012-01-18 16:33:05

相關問題