I have a TextView inside which, I wrote of the questions and answers. If I now want to put in bold only the questions as I do? There maybe some code that gives you the ability to put in bold text character 0-10 for example?
Asked
Active
Viewed 488 times
2 Answers
2
What about this way
textView.setText(Html.fromHtml("MyText<b>MyBoldText</b>"));
Output shall be like this "MyTextMyBoldText"
and you can also do this using string
<string name="myMixedText">My simple Text<b>My Bold Text<i>MyBoldItalicText</i></b></string>
now
textView.setText(R.string.myMixedText);
Output shall be like this "My simple TextMy Bold TextMyBoldItalicText"

Trikaldarshiii
- 11,174
- 16
- 67
- 95
-
Many Thanks, it work! I put the characters in strings.xml and then the TextView (xml) I put android: text = "@ string / name". – Mariocci Rossini Sep 22 '13 at 04:41
-
@MariocciRossini yes this will also works on xml layout file and if it helps then rate and accept it – Trikaldarshiii Sep 22 '13 at 04:42
1
Your question has been answered here :
Multiple TypeFace in single TextView
Just add the CustomTypefaceSpan class, and use Typeface.BOLD and any other font you want to use.

Community
- 1
- 1

Abhishek Kumar
- 378
- 2
- 8