android - Changing menu item's text background in toolbar -
how change menu item's text background while clicking on it? higlight color on whole item right, seems text has it's own background color. think deal in settin on app:popuptheme, don't know style parameters should set.
kindly use , set desired color.
@override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { inflater.inflate(r.menu.your_menu, menu); int positionofmenuitem = 0; // or whatever... menuitem item = menu.getitem(positionofmenuitem); spannablestring s = new spannablestring("my menuitem"); s.setspan(new foregroundcolorspan(color.red), 0, s.length(), 0); item.settitle(s); }
Comments
Post a Comment