-
Notifications
You must be signed in to change notification settings - Fork 41
TabLayoutFont
Ivan Kocijan edited this page Oct 13, 2015
·
1 revision
Font can be added to TabLayout only from code and only after Tabs have been added to TabLayout.
- Instead of TabLayout from design library use the one from MagicViews
<com.ivankocijan.magicviews.views.MagicTabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="100dp"/>- Add tabs to TabLayout and set the font
MagicTabLayout tabLayout = (MagicTabLayout) findViewById(R.id.tab_layout);
tabLayout.addTab(tabLayout.newTab().setText("Tab 1"));
tabLayout.addTab(tabLayout.newTab().setText("Tab 2"));
tabLayout.setFont("yourfont.ttf");