I am adding a style to my Actionbar and everything works fine until I try to change the title of the Actionbar. When I add style to the Actionbar title, the title just disappears. The action bar still exists, but there is simply no name.
This is my Actionbar style code.
<style name="Theme.TabTheme" parent="Theme.AppCompat">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/dark_primary</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowActionBar">true</item>
<item name="android:actionBarStyle">@style/Theme.TabTheme.MyActionBar</item>
<item name="android:actionBarTabStyle">@style/MyActionBarTabs</item>
</style>
<style name="Theme.TabTheme.MyActionBar" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:background">@color/primary</item>
<item name="android:height">50dp</item>
<item name="android:titleTextStyle">
@style/Theme.TabTheme.MyActionBar.TitleTextStyle
</item>
</style>
<style name="Theme.TabTheme.MyActionBar.TitleTextStyle"
parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/primary_text</item>
<item name="android:text">@string/app_name</item>
<item name="android:textSize">15sp</item>
</style>
<style name="MyActionBarTabs" parent="Theme.AppCompat">
<item name="android:background">@drawable/actionbar_tab_indicator</item>
</style>
Why is style added to the Actionbar title, causing the title to disappear?
source
share