Change ActionBar text color

I want to change my ActionBar color to blue (#0c01e3). My code is working because the actionbar background property is doing its job. But the text won't change. Any ideas? I'm using ABS.

<style name="MyActionBar1" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
        <item name="android:backgroundSplit">#06e301</item>
        <item name="android:backgroundStacked">#06e301</item>
        <item name="android:background">#06e301</item>
        <item name="background">#06e301</item>
        <item name="backgroundSplit">#B9001F</item>
        <item name="android:textColor">#0c01e3</item>
        >

Update

:

Answers


On the theme, there is an attribute, actionItemTextColor, which controls this color.

Remember to specify it with and without the android: prefix when using ActionBarSherlock.


Set this in your Java Page .It works for me

ActionBar ab = getActionBar();    
 ab.setTitle(Html.fromHtml("<font color='#ffffff'>App Name</font>"));

add this and then try

    <item name="android:textColor">#ffffff</item>

To improve on the answer of @IntelliJ Amiya:

    getActionBar().setTitle(
            Html.fromHtml("<font color='" + getResources().getColor(R.color.my_color) + "'>"
                    + getString(R.string.title_home) + "</font>"));

If you want to change that using xml ... This is what worked for me ...

<style name="MyActionBar"
    parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/titleBarBgColor</item>
    <item name="android:titleTextStyle">@style/EldTheme.ActionBar.TitleTextStyle</item>
    <item name="android:subtitleTextStyle">@style/EldTheme.ActionBar.TitleTextStyle</item>
    <!-- Support library compatibility -->
    <item name="background">@color/titleBarBgColor</item>
    <item name="titleTextStyle">@style/EldTheme.ActionBar.TitleTextStyle</item>
    <item name="subtitleTextStyle">@style/EldTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="EldTheme.ActionBar.TitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
    <item name="android:textColor">@color/titleBarTextColor</item>
</style>

Need Your Help

Disable redirect to java.com on mobile when using deployJava.js

java javascript applet deployjava

I'm using Java Deployment Script on my web application using this code.

ADF Custom Components

java oracle jsf java-ee oracle-adf

Where is the best place to find custom compnonents? Ideally a repository, as opposed to finding a few here and there. We are currently about to re-design our look and feel UI for about 200 forms an...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.