1

我想更改 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>
4

1 回答 1

4

添加此样式

<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

于 2016-02-01T01:32:20.603 回答