Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change ActionBar title text color

I've been trying to find solution but none worked for me. Activity theme:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/white</item>
    <item name="actionBarTheme">@style/MyActionBar</item>

</style>

<style name="MyActionBar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">@color/colorPrimaryDesignV4</item>
    <item name="android:windowActionModeOverlay">true</item>
    <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
    <item name="colorControlNormal">@color/white</item>
    <item name="android:titleTextStyle">@style/TitleText</item>
</style>

<style name="TitleText" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">#DE0F17</item>
    <item name="android:textSize">20sp</item>
</style>

all the attributes in MyActionBar work fine but last one. Title color and sizes are unaffected no matter what.

how can i change it?

like image 617
Aps Avatar asked Dec 02 '16 12:12

Aps


People also ask

How do you change the color of the title bar on Android?

In method 1 Just go to the activity_main. xml file and add a TextView in the toolbar widget with the text color attribute.


1 Answers

I am using this and it works for me

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="titleTextColor">@android:color/white</item>
    <item name="subtitleTextColor">@android:color/white</item>
</style>
like image 109
Murat Karagöz Avatar answered Oct 11 '22 03:10

Murat Karagöz