将汉堡图标的颜色更改为 android 工具栏
Change color of burger icon into android toolbar
我已经在主菜单中集成了一个工具栏 activity,现在我想更改图标 berger 的颜色和项目菜单的背景颜色:
<?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>
试试这个:
<?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>
我已经在主菜单中集成了一个工具栏 activity,现在我想更改图标 berger 的颜色和项目菜单的背景颜色:
<?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>
试试这个:
<?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>