Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change actionbar title and subtitle font size in android?

This is what I try but nothing happen

<style name="MyCustomTheme" parent="Theme.Freshchat.Light.DarkActionBar">
    <item name="titleTextStyle">@style/Style1</item>
</style>

<style name="Style1" parent="@android:style/Widget.TextView">
    <item name="android:textSize">12sp</item>
</style>

For more context, I am using Freshchat chat widget and want to change the Title and Subtitle font size. Thanks!

like image 413
Rafi Putra Arriyan Avatar asked Oct 21 '25 15:10

Rafi Putra Arriyan


1 Answers

Try this your can you Toolbar

<android.support.v7.widget.Toolbar
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/myToolbar"
  android:layout_width="match_parent"
  android:layout_height="?attr/actionBarSize"
  app:titleTextAppearance="@style/ToolbarTitleTheme"
  app:subtitleTextAppearance="@style/ToolbarSubtitleTheme">
</android.support.v7.widget.Toolbar>

than create Style in Style.xml

<style name="ToolbarTitleTheme" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
    <item name="android:textSize">20dp</item>
    <<item name="android:textColor">#FFAA12</item>
    <!-- include other attributes you want to change: textColor, textStyle, etc -->
</style>

<style name="ToolbarSubtitleTheme" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
    <item name="android:textSize">14dp</item>
    <item name="android:textColor">#FFAA12</item>
</style>
like image 53
AskNilesh Avatar answered Oct 23 '25 04:10

AskNilesh