0

I am use Navigation Drawer from com.android.support:design:23.0.1, i need set custom fonts for menu item. How can do it?

tahsinRupam
  • 6,325
  • 1
  • 18
  • 34
FredGan
  • 397
  • 1
  • 6
  • 9
  • Possible duplicate of : http://stackoverflow.com/questions/33450325/how-to-use-custom-font-in-drawerlayout-and-navigationview?noredirect=1#comment54688471_33450325 – Bubu Oct 31 '15 at 14:27
  • I try this solution, but only toolbar title apply new Fonts. – FredGan Oct 31 '15 at 14:56

1 Answers1

0

In your navigation drawer adapter use this method for applying custom fonts to the textviews of the list

public static void setFont(Context c, TextView... tv) {
        Typeface tf = Typeface.createFromAsset(c.getAssets(),
                "font_name.ttf");
        for (int i = 0; i < tv.length; i++) {
            tv[i].setTypeface(tf);
        }
    }

Store the font in assets folder. This is for multiple text views you can use same for just single textview by remove the for loop

Arshad
  • 1,262
  • 16
  • 25
  • I use android.support.design.widget.NavigationView. How i can get access in LIstView? – FredGan Oct 31 '15 at 16:40
  • Put this Function in a global file And then you can access this function by using className like MyClass.setFont(context, textView) – Arshad Nov 01 '15 at 17:07