如何更改DrawerToggle的波纹颜色(后退箭头)

时间:2015-03-17 14:56:47

标签: android drawertoggle

我想改变DrawerToggle的波纹颜色,但我无法找到任何方法。我的样式文件看起来像这样。这会更改其他菜单项背景,但不适用于后退箭头。如何更改抽屉箭头的波纹颜色

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#FF0000</item>
    <item name="colorPrimaryDark">#660000</item>
    <item name="android:textColorPrimary">#FFFFFF</item>
    <item name="android:textColorSecondary">@android:color/white</item>
    <item name="android:actionMenuTextColor">@android:color/white</item>
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
    <item name="android:actionBarItemBackground">@drawable/my_ripple_borderless</item>
    <item name="selectableItemBackground">@drawable/my_ripple</item>
    <item name="android:selectableItemBackground">@drawable/my_ripple</item>
    <item name="listChoiceBackgroundIndicator">@drawable/my_ripple</item>
    <item name="android:listChoiceBackgroundIndicator">@drawable/my_ripple</item>
</style>


<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <!--<item name="spinBars">false</item>-->
    <item name="color">@color/drawer_icon_color</item>
</style>

1 个答案:

答案 0 :(得分:2)

添加此款式

<style name="AppTheme.Toolbar">
    <item name="colorControlHighlight">@color/colorControlHighlight</item>
</style>

到你的工具栏

<android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:theme="@style/AppTheme.Toolbar"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

原始答案: https://stackoverflow.com/a/30676995/2311651