ActionBarDrawerToggle v7 arrow color

前端 未结 4 2083
梦如初夏
梦如初夏 2020-12-15 21:43

When I try to change navigation drawer toggle color, only hamburger changes it, arrow keeps her native color. You can see it here -

相关标签:
4条回答
  • 2020-12-15 22:18

    Try this one to change color of DrawerArrow

    <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">@android:color/white</item>
    </style>
    
    0 讨论(0)
  • 2020-12-15 22:31

    You could set custom arrow or other icon using the method

    toolbar.setNavigationIcon(Int drawable resource);
    
    0 讨论(0)
  • 2020-12-15 22:33

    This worked for me:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                mDrawerToggle.getDrawerArrowDrawable().setColor(getColor(R.color.drawer_toggle_color));
            } else {
                mDrawerToggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.drawer_toggle_color));
            }
    
    0 讨论(0)
  • 2020-12-15 22:39

    Try using

            <item name="colorControlNormal">@color/your_color</item>
            <item name="android:colorControlNormal">@color/your_color</item>
    

    instead of your drawer arrow style.

    To clear out my comment, try also:

        <item name="actionBarStyle">@style/My.ActionBar.Style</item>
    

    and then:

         <style name="My.ActionBar.Style" parent="Widget.AppCompat.ActionBar">
    
            <item name="colorControlNormal">@color/your_color</item>
            <item name="android:colorControlNormal">@color/your_color</item>
    
        </style>
    
    0 讨论(0)
提交回复
热议问题