如何更改弹出菜单背景的颜色

how to change the color of PopupMenu background

我正在使用以下代码创建弹出菜单.. 我需要更改菜单的背景颜色。我该怎么做。请帮忙

//Creating the instance of PopupMenu  
            PopupMenu popup = new PopupMenu(ctx, holder.ll_overflow);  
            //Inflating the Popup using xml file  
            popup.getMenuInflater().inflate(R.menu.bday_contacts_menu, popup.getMenu());  

            //registering popup with OnMenuItemClickListener  
            popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {  

            @Override
            public boolean onMenuItemClick(MenuItem item) {



                return true;
            }

            });  

            popup.show();//showing popup menu  

您可以使用样式更改它

   <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>