【问题标题】:How to change the ripple color of the DrawerToggle (back arrow)如何更改 DrawerToggle 的波纹颜色(后退箭头)
【发布时间】:2015-03-17 14:56:47
【问题描述】:

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

【问题讨论】:

标签: android drawertoggle


【解决方案1】:

添加此样式

<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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-07
    • 1970-01-01
    • 2017-11-13
    • 2015-01-03
    • 2017-07-09
    • 1970-01-01
    • 1970-01-01
    • 2017-03-30
    相关资源
    最近更新 更多