Details:
I'm extending ActionBarActivity.
Eclipse and SDK fully patched as of 2011-11-06.
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14" />
Deployed to Samsung device with Android 2.3.3
Application has android:theme="@android:style/Theme.Light"
Issue: application is light, but ActionBar is blue with grey icons, hardly visible against the blue background color. I also want the ActionBar to be light, so they grey icons are more visible.
I've tried modifying the styles but to no avail.
I'm probably missing something trivial.
How do I change the background color of the ActionBar of an ActionBarActivity using XML ?
I had the same problem, where my Action Bar would turn grey when I entered that code. Chances are your original style sheet looked like this:
The "DarkActionBar" was what was keeping your Action Bar grey. I changed it to this, and it worked:
I also threw in how to edit the text color. Also, no need to change anything surrounding the resources.
-Warren
Use this, it would work.
This is how you can change the color of Action Bar.
From your MainActivity.java change the action bar color like this
As per documentation - "You can control the behaviors and visibility of the action bar with the ActionBar APIs, which were added in Android 3.0 (API level 11)."
So, ActionBar will not work for your target environment which is at API level 10 (Android 2.3.3).
Just in case, if you target for minimum API level 11 , you can change ActionBar's background color by defining custom style, as:
And, set "MyTheme" as theme for application / activity.
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 :)
Direct add this line with your color code
not need to create ActionBar object every time...