AppCompatActivity定义颜色主题和菜单主题

样式:
<resources>
    
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        
        <item name="colorPrimary">@color/colorPrimaryitem>
        
        <item name="colorPrimaryDark">@color/colorPrimaryDarkitem>
        
        <item name="colorAccent">@color/colorAccentitem>
        
        <item name="android:windowBackground">@android:color/holo_green_darkitem>
        
        <item name="actionOverflowMenuStyle">@style/msitem>
    style>
    <style name="ms" parent="@style/Widget.AppCompat.Light.PopupMenu.Overflow">
        
        <item name="overlapAnchor">falseitem>
        
        <item name="android:popupBackground">?attr/colorPrimaryitem>
        
        <item name="android:dropDownVerticalOffset">1dpitem>
    style>
resources>
 
  
菜单:

xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"

    xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:title="Item"
        android:icon="@drawable/ic_action_bars"
        android:showAsAction="always"
        />
    <item android:title="Item"
        android:icon="@drawable/ic_action_bell"
        android:showAsAction="always"
        >
        <menu>


            <item android:title="Item" />
            <item android:title="Item" />
            <item android:title="Item" />
        menu>
        item>
menu>

你可能感兴趣的:(android)