android - setting background color of options menu panel manually -


i have noticed in devices of higher versions, background color of options menu default set black. need change white, text color black.

i had googled , found many answers, none of them seemed useful me yet.

the suggestion tried adding in oncreateoptionsmenu:

getlayoutinflater().setfactory(new factory() { @override public view oncreateview(string name, context context, attributeset attrs) {  if (name     .equalsignorecase(“com.android.internal.view.menu.iconmenuitemview”)) { try { layoutinflater f = getlayoutinflater(); final view view = f.createview(name, null, attrs);  new handler().post(new runnable() { public void run() {  // set background drawable view     .setbackgroundcolor(color.black);  // set text color ((textview) view).settextcolor(color.white); } }); return view; } catch (inflateexception e) { } catch (classnotfoundexception e) { } } return null; } }); return super.oncreateoptionsmenu(menu); 

but, didn't me out.

i searching through stackoverflow, , think found matching answer question.

please go through link once...

set title background color


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -