2

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?

Mariocci Rossini
  • 97
  • 1
  • 1
  • 9

2 Answers2

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
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