我已经创建了一个带有自己的启动图标的Android应用程序。它和努加特合作得很好。但是对于奥利奥,我的图标被默认的Android图标所取代。我在mipmap资源中为几个密度定义了ic_launcher.png和ic_launcher_round.png。
我的清单包含以下一行:
android:roundIcon="@mipmap/ic_launcher_round"我该怎么做才能让自己的偶像出现在奥利奥身上?
发布于 2018-07-14 09:38:40
对于API 26+默认的Android应用程序模板定义了另一个图标资源文件夹。
mipmap-anydpi-v26
该文件夹(通常)包含两个xml文件ic_launcher和ic_launcher_round,它们匹配在API 26+清单中声明的图标资源。
这些文件的内容如下:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>为了有你的图标,你还需要改变所有的绘图(在所有的密度桶中)--即ic_launcher_background和ic_launcher_foreground。
或者你只需删除该文件夹,在这种情况下,android将倒退到使用你的png图标,但它们不会出现为-原样,通常会绘制在白色背景之上。
您可以在以下网址阅读更多内容:自适应图标
发布于 2018-12-21 08:36:06
最好的解决方案是删除mipmap-anydpi-v26文件夹,然后应用程序将采用默认图标。在模式下,转到这个包
res/mipmap-anydpi-v26
删除它并重新生成并运行项目。
发布于 2021-05-31 05:43:25
我的解决方案:检查res/mipmap-anydpi-v26文件夹,然后您将看到ic_launcher.xml和ic_launcher_round.xml文件编辑这些xml文件,指向要使用的实际png文件:
如果这种png文件在可绘图文件夹中不可用,请添加它。
这就解决了问题。
https://stackoverflow.com/questions/51337076
复制相似问题