3

在带有剪贴画的 Image Asset Studio 中创建启动器图标(Adaptive 和 Legacy)时,会在 mipmap 文件夹中创建图像:

在此处输入图像描述

但是对于 anydpi-v26,前景的标准图标没有改变,尽管背景颜色发生了变化:

在此处输入图像描述

ic_launcher.xml(anydpi-v26):

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

ic_launcher_foreground 文件夹中有两个文件:ic_launcher_foregraund.xml(新图标)和 ic_launcher_foregraund.xml (v24)(标准图标)

为什么他不自动换新图纸?感谢您的任何回答!

4

3 回答 3

4

我遇到过同样的问题。相同的解决方案。由于某种原因,在创建新的启动器图标时,不会删除可绘制文件夹中的旧文件 ic_launcher_foreground.xml。您最终会得到两个具有相同名称的文件。所以删除它(没有安全删除),解决了这个问题。

于 2021-05-27T05:48:55.870 回答
3

我从文件夹 res/drawable/ic_launcher_foreground/ 中删除了 ic_launcher_foreground.xml(v24) 文件,该文件保留在标准图标中。

此操作解决了问题:

在此处输入图像描述

于 2020-04-05T05:30:22.497 回答
1

我遇到了这个问题,因为我的一个库定义了一个启动器图标。奇怪的是,应用程序模块从应用程序模块中读取了 ic_launcher_background,但从库模块中读取了 ic_launcher_foreground。

于 2021-08-04T08:25:24.643 回答