[随笔]设置PopupMenu Style

1、设置背景颜色

<color name="popupwindow_background">#303030</color>

2、设置PopupMenu的style--android:popupBackground

<style name="Theme.PopupMenu" 
       parent="@android:style/Widget.Holo.Light.ListPopupWindow">
       <item name="android:popupBackground">@color/popupwindow_background</item>
</style>

3、将PopupMenu的style加载到Activity需要的style中--android:popupMenuStyle

<style name="Theme.InCallScreen" 
       parent="@android:style/Theme.Holo.NoActionBar">
        <item name="android:popupMenuStyle">@style/Theme.PopupMenu</item>
</style>

4、设置Activity需要的style--android:theme,因为要显示popupmenu的style

<activity android:name="InCallScreen"
          android:theme="@style/Theme.InCallScreen">
</activity>


从以下地址搜索到有关信息

How to set the background of Android PopupMenu to White

你可能感兴趣的:(style,自定义,PopupMenu)