Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ActionBar Text Color

Tags:

android

I have xml like this:

<resources>

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
</style>

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:titleTextStyle">@style/TitleColor</item>
</style>

<style name="MyActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">#800000</item>
</style>

<style name="TitleColor" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">#000099</item>
</style>
</resources>

Background color is properly set, but title color does not change. Where did I make mistake? Thanks!

like image 247
Bade Avatar asked Sep 24 '13 19:09

Bade


1 Answers

Change it to this:

<resources>

    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
    </style>

    <style name="AppTheme" parent="AppBaseTheme">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>

    <style name="MyActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">#800000</item>
        <item name="android:titleTextStyle">@style/TitleColor</item>
    </style>

    <style name="TitleColor" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">#000099</item>
    </style>
</resources>
like image 78
Ahmad Avatar answered Oct 06 '22 07:10

Ahmad