Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android的xml中更改菜单导航图标颜色_Android_Xml - Fatal编程技术网

在Android的xml中更改菜单导航图标颜色

在Android的xml中更改菜单导航图标颜色,android,xml,Android,Xml,我通过Android Studio中的Vector Asset向导制作了一个导航图标,放置在我的工具栏中。默认情况下,图像的颜色为黑色。它没有给我在向导中更改它的选项。那么,有没有办法改变xml中的颜色呢?这是如何在我的工具栏布局文件中设置的: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://sche

我通过Android Studio中的Vector Asset向导制作了一个导航图标,放置在我的工具栏中。默认情况下,图像的颜色为黑色。它没有给我在向导中更改它的选项。那么,有没有办法改变xml中的颜色呢?这是如何在我的工具栏布局文件中设置的:

<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="?attr/actionBarSize"
    android:minHeight="?attr/actionBarSize"
    app:navigationIcon="@drawable/nav_menu_icon">

</android.support.v7.widget.Toolbar>
解决方案,但对我不起作用。其他解决方案以代码形式给出,但如果可能的话,我希望使用xml版本。此外,我的应用程序支持API 16及更高版本。

您可以更改“导航菜单”图标的颜色。 需要在studio或任何编辑器中打开nav_menu_icon.xml并更改属性“fillColor”

默认情况下,它是android:fillColor=“#FF000000”