簡體   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