Friday 15 April 2011

actionbarsherlock - Set MenuItem onPressed actions Android actionbar? Preferably programmatic -


I have created a menu without XML in my class files which are just icons when menu is pressed, then I want to remove the blue square / rectangle highlight, and instead only change the color of the item (with just a new color, code> res ).

My menu is as follows, am I trying to get it possible? I know that this is probably through XML, but this is not what I need.

  @ Override public boolean on cret option menu (menu menu) {super.not option menu (menu); Menu item item = menu.add (menu.NF, 0, menu.NAN, "back"). Set Icon (Android. RDWbackback); Item.setShowAsAction (MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); Back true;  

Edit : If there is space

Image is not possible, I just want to stop highlighting I will settle for But the bonus points for the image swap: P

I want to remove the blue square MenuEdit is pressed when the rectangle highlighted

You can use the properties to identify and modify / modify ( Accent color ).

and instead of just changing the color of the item (by showing the same color picture with only a new color, res ).

You should use two colorful versions of your image (default and pressed) within the specific used as your icon resource.

No comments:

Post a Comment