首页 > 解决方案 > @mipmap/ic_launcher 未用于应用程序图标

问题描述

我正在更改应用程序启动器图标并使用说明res/mipmap/ic_launcher修改了图标。在 Android Studio 中,我看到了正确的修改图标。

但是,设备上仍显示原来的默认图标,而不是我绑定的新图标ic_launcher。我的清单使用指向新值 AFAICT。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.anytune.rxsongbrowsertrials">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
....
</manifest>

为什么不使用ic_launcher图标?

标签: androidandroid-studio

解决方案


我发现了错误。使用Image Asset Studio工具,它在 ic_launcher 资源中为普通 (res/mipmap/ic_launcher) 和圆形版本 (res/mipmap/ic_launcher_round) 版本创建了我的新启动图标,分辨率如下:dpi, dpi, xhdpi, xxhdpi, xxxhdpi. 这些都是 png 文件,所以这些文件可能仍然有问题,因为我希望它们是 .xml 文件。

但是,它没有更新该anydpi-v26决议。这仍然是指带有模板图像的原始可绘制对象。我需要手动更新前景标签以使用我的新可绘制对象。


推荐阅读