更改导航抽屉按钮的颜色(后退按钮)?

时间:2015-04-23 13:09:17

标签: android android-actionbar navigation-drawer

在我的应用程序中,我使用操作栏和导航抽屉。操作栏中有一个用于打开和关闭导航抽屉的按钮。我想把它的颜色改成红色。我该怎么做?

enter image description here

1 个答案:

答案 0 :(得分:1)

您必须在素材主题后设置应用主颜色: (official documentation

RES /值/ colors.xml

<resources>
  <!-- inherit from the material theme -->
  <style name="AppTheme" parent="android:Theme.Material">
    <!-- Main theme colors -->
    <!--   your app branding color for the app bar -->
    <item name="android:colorPrimary">@color/primary</item>
    <!--   darker variant for the status bar and contextual app bars -->
    <item name="android:colorPrimaryDark">@color/primary_dark</item>
    <!--   theme UI controls like checkboxes and text fields -->
    <item name="android:colorAccent">@color/accent</item>
  </style>
</resources>

另一种方法是自己生成图标:Toolbar Navigation Hamburger Icon missing