Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.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 如何更改导航抽屉图标_Android_Android Layout - Fatal编程技术网

Android 如何更改导航抽屉图标

Android 如何更改导航抽屉图标,android,android-layout,Android,Android Layout,下午好 我有个简单的问题。 如何更改导航抽屉中的此图标。 我一直在谷歌上搜索,但对答案感到困惑 提前感谢。在布局文件夹中,您需要查找nav_header_main.xml 单击最底部的文本以查看XML行,您应该会看到这样的ImageView <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap

下午好 我有个简单的问题。 如何更改导航抽屉中的此图标。 我一直在谷歌上搜索,但对答案感到困惑

提前感谢。

在布局文件夹中,您需要查找nav_header_main.xml

单击最底部的文本以查看XML行,您应该会看到这样的ImageView

<ImageView
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/nav_header_vertical_spacing"
        app:srcCompat="@mipmap/ic_launcher_round" />
更改您的可绘图应用程序的app:scrCompat值,仅此而已


希望对您有所帮助

您的xml中会有一个包含nav_header.xml或类似命名布局的布局。名字不重要。搜索该图标,您可以在那里更改位置。

首先将图标导入android studio,然后在res/layout文件夹中找到nav_header.xml。更改图像视图中的src属性

该属性是标题\u布局中的图像视图,或者您的名字或Android Studio所做的任何事情。您的布局目录中是否有drawer\u header.xml或类似内容?谢谢,我真的没有注意到布局文件夹中有导航栏内容。非常感谢。非常感谢,我没有注意到布局下有这个xml,我已经有很多东西了,我希望能在菜单或绘图上找到它。这对我有用。