How can I change font type in Android TextView?
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Welcome!"
android:textSize="20sp" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
android:typefaceattribute. For example:The XML attribute only allows the values
normal,sans,serif, andmonospace. If you want to use a differentTypeface(perhaps a custom one that you ship with your app), you will have to do it in code by callingsetTypeface()for the view after the TextView is loaded.