Changing the FontStyle of Toolbar in Android
1 . Create toolbar.xml and add a style to it android:theme="@style/ToolbarTheme"
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.appcompat.widget.Toolbar | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
android:background="@color/actionbar_bg_color" | |
android:theme="@style/ToolbarTheme"> | |
</androidx.appcompat.widget.Toolbar> |
2 . Add it in styles.xml
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
<!-- Toolbar theme --> | |
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> | |
<item name="android:fontFamily">@font/audiowideregular</item> | |
</style> |
3 . Create a directory font inside res directory . Add the font inside it.
Comments
Post a Comment