Change the color of the ActionBarCompat title but not the color of other texts

I am using the latest support library (V21) which includes material themes (named Theme.AppCompat) and I want to put the ActionBar title white. I tried to achieve this by using the textColorPrimary (as shown there ) attribute in my custom theme

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
    <item name="colorPrimary">@color/orange</item>
    <item name="colorPrimaryDark">@color/orange_dark</item>
    <item name="colorAccent">@color/white</item>

    <!-- This attribut set text color --> 
    <item name="android:textColorPrimary">@color/white</item>
</style>

      

With this I got a white title , but all the text (textview, edittext) was white too ...

Is there a way to only change the title color of the action bar with recently released features, or the only way to use a custom styling for the action bar, as was the case with Holo?

+3


source to share


1 answer


Use @style/Theme.AppCompat.Light.DarkActionBar

to invert the text color only in the action bar.



+4


source







All Articles