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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -