我已下载Android导航抽屉示例项目并尝试使用它。在初始状态,我不知道如何将导航抽屉标题图标更改为不同的图标图像。这个图像究竟在哪里?它是否在任何特定的Res-> drawable文件夹下?请找到截图,我在其中舍入了导航标题图标图像,我想立即更改。
答案 0 :(得分:1)
您可以在AndroidManifest.xml中更改它,将您的图标放在res / drawable文件夹中,并将“logo”参数设置为您的图标,如下所示:
<manifest>
...
<application
...
android:logo="@drawable/your_image_file_name">
</application>
...
</manifest>
答案 1 :(得分:0)
您可以在清单中找到它。它会自动访问@ drawable / ic_launcher作为您的应用程序图标
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Byustudiestab" >
答案 2 :(得分:0)
您应该在AndroidManifest.xml中更改您的应用图标
android:icon="@drawable/ic_launcher"
答案 3 :(得分:0)
这张图片究竟在哪里?它是否在任何特定的Res-&gt; drawable文件夹下?
要查找图像在eclipse中的位置,请执行以下操作:res - &gt;可绘制的
此外,图片可能位于drawable-hdpi,drawable-ldpi,drawable-xhdpi,drawable-xxhdpi
中找到图像位置后,将图像替换为您选择的图像。为图像指定新名称或使其与旧图像保持相同的名称。如果您决定为图像指定一个新名称,则必须转到AndroidManifest.xml并使用新图像替换旧图像的旧名称。
机器人:标志= “@绘制/ your_image_file_name”
答案 4 :(得分:0)
另一种选择:
getSupportActionBar().setLogo(R.drawable.yourImage);
或
getActionBar().setLogo(R.drawable.yourImage);
注意:属性“logo”仅用于API级别11及更高版本的android:logo需要api(如果您不使用getSupportActionBar)