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.
xml file: Just go to res/values/styles. xml file. edit the xml file to change the color of action bar.
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!!!
if you want change the color of ActionBar just do this:
ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable("COLOR"));
see the following link for more info
and if you using ActionMode This is the style used for any ActionMode. You'll need to create your own style to customize it
<style name="Widget.ActionMode">
<item name="android:background">?android:attr/actionModeBackground</item>
<item name="android:backgroundSplit">?android:attr/actionModeSplitBackground</item>
<item name="android:height">?android:attr/actionBarSize</item>
<item name="android:titleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Subtitle</item>
</style>
more info in this site
see this too
Edit
for pre-Honeycomb see this please
maybe this or this helped you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With