【问题标题】:Can't change icon for my android app无法更改我的 Android 应用程序的图标
【发布时间】:2016-12-14 17:12:39
【问题描述】:

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

第二次我右键单击res>new>image asset - 也没有用。

我的 manifest.xml 代码是 as。

 <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 设备。但是,以上都没有奏效。在问这个问题之前,我尝试了其他类似的问题,但没有任何帮助。 Like this one.

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

【问题讨论】:

  • 您是否尝试卸载该应用并重新运行它?
  • 你有多少个 mipmap 文件夹?如果您有超过 1 个,请确保您更改了所有设备
  • @Prera​​kSola Yeap 试过了。现在超过七次。没用。
  • 在不同的设备/模拟器上试试。
  • @MarkoNiciforovic 有 5 个 mipmap 文件夹。我全都变了。不工作。

标签: android android-studio android-manifest


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

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

    它对我有用。

    【讨论】:

    • 没用!如果是这个小错误,我想我会修复它。
    【解决方案3】:

    我终于找到了解决办法!是我的第 3 方启动器 (Evie Launcher) 没有更新图标。更改启动器后,这些图标在包括我的所有设备上都可以正常工作。

    感谢所有的建议和回答。

    【讨论】:

    • 哈哈很有趣
    • 我遇到了同样的问题和同样的解决方案。它是如何工作的
    【解决方案4】:

    终于找到了我犯了很久的错误。

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-31
      • 1970-01-01
      • 2011-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-04
      • 1970-01-01
      相关资源
      最近更新 更多