Ackman
Ackman

Reputation: 1582

TextView make part of text not bold

I have a TextView title. I need it showing half of text bold and other half not bold. The way I set it is shown below:

category.getName() -- > Bold "urinary tract infection" ---->not bold

 title.setText(category.getName()+ "\n(urinary tract infection)");

How do I achieve this?

Upvotes: 2

Views: 231

Answers (1)

slackwars
slackwars

Reputation: 522

You can try formatting you TextView using HTML.

title.setText(Html.fromHtml("<b>"+category.getName()+ "</b>\n(urinary tract infection)"));

Upvotes: 2

Related Questions