How do I change the background color of the ActionBar of an ActionBarActivity using XML?

user77115

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 ?

lupchiazoem

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:

<resources>
    <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:background">ANY_HEX_COLOR_CODE</item>
    </style>
</resources>

And, set "MyTheme" as theme for application / activity.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to set ActionBar background in ActionBarActivity

How do I change a tab background color when using TabLayout?

How do I change the background color of a Table using code? WatchKit

How do I change the background color of div using jquery?

How to change background color of xml by using spinner

How do I change the color of the ActionBar hamburger icon?

How do I change the background color with JavaScript?

How do I change the background color of the body?

How do I change a background color in JS?

How do I change the background color in JavaScript?

Change ActionBar OverflowMenu Background color

how to change actionbar color using AppCompactActivity?

How do I get the event listener to change my css background color using javascript?

Using jquery and css how do I create a delayed background color change animation?

How do I change the whole page background color with each route using React?

How to change ActionBar menu background color (android 4 & 5)

How do I change the background color of a QtQuick Window?

How do i change input field background color based on onclick?

How do I change the background color of a tabbed page in Xamarin iOS?

how do I change my header background color?

How do I change the background color of a unicode symbol?

How do I change the entire background color in an RMarkdown HTML Document?

How do I change button background and text color?

How do I change the background color of a cell in Pandas?

How do I change the ripple background color on Button?

How do I change the vuetify theme background color

How do I change the Windows 8.1 background color?

How do I change the background color of a JFrame dynamically?

How do I change the background color of a button in Kivy?