How to change ActionMode background color in Android

Love Garg picture Love Garg · Dec 25, 2013 · Viewed 34.3k times · Source

i am creating an android app in which support level api is 7 so i am using sherlock actionbar. I am using action mode in it. Issue is i want to change the background of action mode. So i have tried

    <item name="android:background">@color/something</item>
    <item name="android:backgroundStacked">@color/something</item>
    <item name="android:backgroundSplit">@color/something</item>

these style solution's available but none of them works. enter image description here

Answer

Kokusho picture Kokusho · May 20, 2014

In my case i resolved with this. First i created a style to define the actionModeBackground:

<style name="MyTheme.ActionMode" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionModeBackground">#FFFFFF</item>
</style>

Then i add the style into my base application theme:

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:actionModeStyle">@style/MyTheme.ActionMode</item>
</style>

Hope it helps!!!