Skip to content

Instantly share code, notes, and snippets.

@ar-android
Created June 15, 2015 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar-android/f4b48a999fa4e5a3040b to your computer and use it in GitHub Desktop.
Save ar-android/f4b48a999fa4e5a3040b to your computer and use it in GitHub Desktop.
Set Style TextView
You can do programmatically using setTypeface():
textView.setTypeface(null, Typeface.NORMAL); // for Normal Text
textView.setTypeface(null, Typeface.BOLD); // for Bold only
textView.setTypeface(null, Typeface.ITALIC); // for Italic
textView.setTypeface(null, Typeface.BOLD_ITALIC); // for Bold and Italic
XML:
You can set Directly in XML file in <TextView /> like:
android:textStyle="normal"
android:textStyle="normal|bold"
android:textStyle="normal|italic"
android:textStyle="bold"
android:textStyle="bold|italic"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment