Alex Rivera | Logout

How to set TextView textStyle such as bold, italic

Asked 2011-06-01T11:41:19.843
965

How to set TextView style (bold or italic) within Java and without using the XML layout?

In other words, I need to write android:textStyle with Java.

Edit
Report

1 Answer

12

It would be

yourTextView.setTypeface(null,Typeface.DEFAULT_BOLD);

and italic should be able to be with replacing Typeface.DEFAULT_BOLD with Typeface.DEFAULT_ITALC.

Let me know how it works.

answered 2011-06-01T11:47:51.833

Your Answer