繁体   English   中英

无法更改我的 android 应用程序的图标

[英]Can't change icon for my android app

首先,我将一些图标复制到mipmap (名为 ic_launcher.png) - 没有用。

其次,我右键单击res>new>image asset - 也不起作用。

我的 manifest.xml 代码如下。

 <application
    android:name=".BlogI"
    android:allowBackup="true"
    android:icon="@mipmap/applicationicon"  // This even shows the right icon in right corner along with the line numbers
    android:label="@string/app_name"
    ......
    ......

我尝试了干净的项目并重新运行,重新启动了我的 android studio(甚至我的 PC)也重新启动了我的 android 设备。 但是,以上都没有奏效。 在问这个问题之前,我尝试了其他类似的问题,但没有任何帮助。 像这个。

如果有任何替代品,请提出建议! 谢谢!

生成图像资产时,删除ic_launcher.xml保留png文件。 xml 文件具有 ic_launcher_foreground 属性,该属性会覆盖默认的 android 启动器图标。

首先将您的图像粘贴到drawable然后在manifest.xml添加以下代码

 <application
        android:name=".BlogI"
        android:allowBackup="true"
        android:icon="@drawable/your_Image"
        android:label="@string/app_name">`

它对我有用。

我终于找到了解决办法! 是我的第 3 方启动器(Evie Launcher)没有更新图标。 更改启动器后,这些图标在包括我的在内的所有设备上都运行良好。

感谢所有的建议和答案。

终于找到了我长期以来一直在做的错误。

只需确保在AndroidMainfest.xml您已正确设置了两个属性 - android:iconandroid:roundIcon

<application
    android:icon="@mipmap/app_icon"
    android:roundIcon="@mipmap/app_icon".../>

我只是设置android:icon并保持android:roundIcon不变。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM