定制页面背景及Actionbar overflow menu的背景色

定义theme和style, 注意是actionOverflowMenuStyle 和 android:windowBackground.(实测5.1.1和7.1.1)
<style name="AppTheme" parent="Theme.AppCompat.Light">
        <item name="actionOverflowMenuStyle">@style/CustomActionOverflowMenuStyle</item>
        <item name="android:windowBackground">@android:color/white</item>
    </style>

    <style name="CustomActionOverflowMenuStyle" parent="Widget.AppCompat.Light.PopupMenu.Overflow">
        <item name="android:overlapAnchor">false</item>
        <item name="android:popupBackground">@android:color/white</item>
    </style>

refer to:http://stackoverflow.com/questions/19659637/how-to-change-the-background-color-of-action-bars-option-menu-in-android-4-2

猜你喜欢

转载自enuocm.iteye.com/blog/2359458
今日推荐