My code is as below and while it works ( when I change the parent Theme to Theme.Sherlock or Theme.Sherlock.Light the Theme it does changes) it does not changes the Title co
If you want to change the ActionBar title color just follow this first. Go to style.xml and use the following code inside resources
<style name="ActionBar.Solid.Ribbit.TitleTextStyle"
parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/actionBarTextColor</item>
</style>
Simplest way that worked for me is to add the following in theme style:
<item name="android:textColorPrimary">@color/orange_dark</item>
i have changed title color like this
actionBar.setTitle(Html.fromHtml("<font color='#ff0000'>ActionBarTitle </font>"));
Use below code to provide different color to actionbar text and actionbar background just use below theme in manifest against the activity in which you want output :)
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">@style/TitleBarTextColor</item>
<item name="android:background">YOUR_COLOR_CODE</item>
</style>
<style name="TitleBarTextColor" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">YOUR_COLOR_CODE</item>
</style>
If you are trying to change the title text where you have a custom toolbar then try adding app:titleTextColor
to the toolbar as below:
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@color/colorWhite" />
From Jake Wharton's ActionBarSherlock site :
Mirrored Attributes
Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation.
Had to change MyTheme.ActionBarStyle to :
<style name="MyTheme.ActionBarStyle" parent="@style/Widget.Sherlock.ActionBar">
<item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
Now the Title text color has changed.