Custom font for tabs on Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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