So I'd like to change the fontFamily in Android but i want to use different font family for header and sub text.How can i achieve it..?
Asked
Active
Viewed 380 times
2 Answers
0
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Enter the password :"
android:textColor="#000000"
android:fontFamily="sans-serif"
android:layout_marginTop="75dp"/>

Jeffy
- 276
- 3
- 9
0
If you want to use different font which is not availabe in font-family then you can download that font from internet and then
Put your font in assets folder, then create new Typeface from it
Here is an example
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "SomeFont.ttf");
txt.setTypeface(font);

Nilesh
- 1
- 1