I've been trying to create my own action item, but it has benn impossible for me.
What I'm tryind to do, is creating a custom action item layout (color background for example), something like "Thumbs" action bar. I only want to change action items only for one of my activities.
I've been playing with android:icon and android:actionLayout property for action menu items.. but I got nothing.
Actually, I've seen another threads in StackOverflow, but it didn't help me ...
Building ActionMode with custom layout in ActionBarSherlock
styling ActionbarSherlock: textColor of the action-items
Any ideas? Thanks in advance!
To override
ActionBarSherlock
themes you should proceed like this:Open
values/abs__themes.xml
fromActionBarSherlock
library project. You see for example:When you have found the item you want to customize (
actionBarItemBackground
in your case), you create your ownthemes.xml
inside your project, and add in it:This overrides the default
Theme.Sherlock
, setting a customactionBarItemBackground
.Now, instead of using
Theme.Sherlock
in your activity you should usesetTheme(R.style.Custom_Theme_Sherlock)
. You may also want to override the other two themes (Theme.Sherlock.Light
andTheme.Sherlock.Light.DarkActionBar
)One more tip, here is the drawable selector used by
ActionBarSherlock
for the default action item background (in holo_light), it uses 9-patch png drawables:For other basic customizing, you can use this tool, it generates styles for you.