Goofy
Goofy

Reputation: 6128

Programmatically set the Typeface and set text style in xml not working

I have a textview defined in xml, now i am setting the Typeface programmatically like this:

textView.setTypeface(APP_FONT_REGULAR); // which is custom font in assests (.ttf file).

now i have set android:textStyle="bold" in xml

but it's not applying bold?

what is the reason i need to apply my own Typface and set it to bold also.

Upvotes: 0

Views: 266

Answers (1)

Simon Dorociak
Simon Dorociak

Reputation: 33515

i need to apply my own Typface and set it to bold also.

You can set appearance when you call setTypeface() like this

textView.setTypeface(APP_FONT_REGULAR, Typeface.BOLD);

it solve your problem. Check it out.

Upvotes: 1

Related Questions