2014-03-31 141 views
0

Android文本視圖。
有沒有辦法改變TextView中顯示的一些字符爲粗體,如下所示?設置textview的某些字符粗體

enter image description here

+0

請參閱http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview – Adil

回答

3

嘗試像

textView.setText(Html.fromHtml("Text" + "<b>" + View + "</b>")); 
4

你可以嘗試以下

yourTextView.setText(Html.fromHtml("Here you write html formatted text")); 
0

你可以採取兩種TextView的,並顯示您的文字是一個大膽而另一種是沒有任何效果的簡單的解決方案。

1

您可以使用以下方法中的TextView格式化HTML文本和展示。

String value= "Text" + "<b>" + "View" + "</b>"; 
myTextView.setText(Html.fromHtml(value));