【问题标题】:Unable to change app icon无法更改应用图标
【发布时间】:2016-05-18 06:13:08
【问题描述】:

我正在尝试更改我已经开发的 Android 应用程序的启动图标。我右键单击 res 文件夹。转到新的 --> 图像资产并更改那里给出的路径。

它向我确认了一些文件将被更新等等。但我的启动图标没有改变。

最重要的是,当我返回 res --> new --> 图像资产时,路径已自行更改回原始路径:

C:\Program Files\Android\Android Studio1\plugins\android\lib\templates\gradle-projects\NewAndroidModule\root\res\mipmap-xhdpi\ic_launcher.png

上述路径甚至不是我项目的一部分。我无法确定,这是硬编码的。请帮忙。

【问题讨论】:

  • 您好!我的回答对你有帮助吗?您介意将我的答案标记为正确吗? :)

标签: android icons launch android-launcher


【解决方案1】:

您可以更改图标,只需长按应用程序,就会显示此弹出菜单。点击编辑。接下来,点击左侧的原始图标。您可以从包中选择一个新图标,也可以从图库中的图像创建一个。 您可以通过安装自定义启动器来更改图标,

【讨论】:

  • 我认为问题在于在将应用程序的图标上传到 PlayStore 之前为所有用户更改图标,而不仅仅是在手机上为他自己。
  • 是的 Fabian 没错。我正在寻找更改应用程序图标...在将其上传到 google playstore 之前。
【解决方案2】:

转到您的应用程序 AndroidManifest.xml 文件并使用您的图标更改 android:icon 属性

<application
        android:allowBackup="true"
        android:icon="@drawable/your_icon" 
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

【讨论】:

    【解决方案3】:

    在 Android Studio 上,右键单击应用的根文件夹 > New > Image Asset > Launcher Icons 并设置新图标即可解决问题并覆盖现有图标。

    如果没有,请先尝试删除项目树中的资产,然后重试。 You have to delete every resolution of it!

    【讨论】:

      【解决方案4】:

      我在我的应用中做了这样的:

      1. 删除项目中名为 ic_launcher.png 的每个文件
        (主要在android studio下的project->src->res->drawable/mipmap...)
      2. 将您自己的图标 png 重命名为:ic_launcher.png
      3. 将您的图标拖放到 'mipmap' 或 'drawable' 文件夹中,具体取决于文件之前的位置,在您的 android studio 项目中。

      完成:)

      【讨论】:

      • 我尝试更改 android 清单,但没有任何反应。默认的android启动器不断出现。它从我在上面的问题中提到的路径中获取ic_launcher.png。并且复制到那条路似乎不像上帝的做法!
      • 编辑了我的答案。从您的项目中制作安全副本并尝试我的方法。如果它弄乱了你的项目,你就有了副本。告诉我你是什么人
      【解决方案5】:

      您应该在所有 mipmap 文件夹中添加新图标,例如 xxxhdpi、xxhdpi、xhdpi

      【讨论】:

        【解决方案6】:

        首先在mipmap中添加所有应用程序的图标大小,如mdpi、hdpi、xhdpi、xxhdpi和xxxhdpi。然后将名称放在android:icon属性中。

        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
        </application>
        

        【讨论】:

          猜你喜欢
          • 2016-05-31
          • 1970-01-01
          • 1970-01-01
          • 2020-10-22
          • 1970-01-01
          • 2013-06-03
          • 2014-03-02
          • 1970-01-01
          • 2012-07-24
          相关资源
          最近更新 更多