[英]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:icon
和android:roundIcon
<application
android:icon="@mipmap/app_icon"
android:roundIcon="@mipmap/app_icon".../>
我只是设置android:icon
并保持android:roundIcon
不变。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.