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...
Comments
Post a Comment