Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom font for tabs on Android
<!-- add this new style to your style.xml -->
<style name="TabBar.TitleText" parent="TextAppearance.Design.Tab">
<!--set your custom font properties-->
<item name="android:fontFamily">@font/comicsaaaans</item>
</style>
<!-- Tabbar.axml -->
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="@android:color/white"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabTextAppearance="@style/TabBar.TitleText"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment