android - how to change the color of PopupMenu background -


i using following code creating pop menu.. need change background color of menu.. how can that. please help.

//creating instance of popupmenu               popupmenu popup = new popupmenu(ctx, holder.ll_overflow);               //inflating popup using xml file               popup.getmenuinflater().inflate(r.menu.bday_contacts_menu, popup.getmenu());                //registering popup onmenuitemclicklistener               popup.setonmenuitemclicklistener(new popupmenu.onmenuitemclicklistener() {                @override             public boolean onmenuitemclick(menuitem item) {                    return true;             }              });                popup.show();//showing popup menu   

you can change using styles

   <style name="appbasetheme" parent="@android:style/theme.light.notitlebar">  </style>  <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <item name="android:popupmenustyle">@style/popupmenu</item>     </style>  <style name="popupmenu" parent="@android:style/widget.popupmenu"> <item name="android:popupbackground">@android:color/white</item> <item name="android:textcolor">#ff01f0</item> <item name="android:textsize">12sp</item> </style> 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -