改变颜色为Android的工具栏

改变颜色为Android的工具栏

问题描述:

我已经集成了一个工具栏,主要活动,现在我想改变图标Berger和项目菜单的背景色的颜色:改变颜色为Android的工具栏

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" android:layout_height="wrap_content" 
    android:id="@+id/toolbar" 
    android:fitsSystemWindows="true" 
    android:theme="@style/toolbar" 
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

</android.support.v7.widget.Toolbar> 

和样式文件是:

<resources> 

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 
</resources> 
+0

的可能的复制【如何改变材料宫汉堡包图标的颜色点击导航抽屉](http://*.com/questions/31870132/how-to-change-color-of-hamburger-icon-in-material-design-navigation-drawer) –

尝试使用这样的:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/toolbar" 
    android:fitsSystemWindows="true" 
    app:theme="@style/backArrowTheme" 
    app:popupTheme="@style/AppTheme" 
    >  
</android.support.v7.widget.Toolbar> 


<style name="backArrowTheme" parent="AppTheme"> 
    <item name="android:textColorSecondary">Hexcode of color</item> 
</style> 
+0

工作好,竖起大拇指, 其他请把它用于背景菜单项也是可能的 –