如何在Android中的ActionBar中更改DrawerArrowToggle(汉堡包)的颜色?

时间:2016-04-06 16:55:24

标签: android android-actionbar

我想将Android应用的操作栏中的汉堡图标颜色更改为白色。它默认为灰色。我使用的是Theme.AppCompat.Light.DarkActionBar样式并设置了drawerArrowStyle属性,但它似乎不会影响颜色。

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/orderview_blue</item>
        <item name="colorControlActivated">@color/orderview_blue</item>
        <item name="drawerArrowStyle">@style/AppDrawerCustom</item>
    </style>

    <style name="AppDrawerCustom" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="color">@android:color/white</item>
        <item name="spinBars">true</item>
    </style>

</resources>

ActionBar with gray hamburger

2 个答案:

答案 0 :(得分:0)

将'colorControlNormal'添加到您自定义的样式中

<style name="AppDrawerCustom" parent="Widget.AppCompat.DrawerArrowToggle">
       <item name="colorControlNormal">@color/white</item> 
</style>

答案 1 :(得分:0)

更新:通过更新以使用Android SDK的第23版进行构建,我能够解决此问题。我意识到我正在构建版本21,并且在使用版本23构建时不会发生此问题。