简体   繁体   中英

App icon is not changing in Xamarin forms

I have a PNG icon file named icon.png and I want to use it as my Xamarin.Form app's icon. So here's what I've done -

  • Changed Application Icon from Android Options
  • Changed Icon = "@mipmap/icon" in MainActivity.cs file

Still it was showing the default Xamarin logo icon. Then I did the followings -

  • Changed <foreground android:drawable="@mipmap/icon" /> in icon.xml file
  • Changed <foreground android:drawable="@mipmap/icon" /> in icon_round.xml file

Now the default android icon is showing but not my icon. What to do? Please help.

I tried matching all the icons dimension to the default icons dimension, also tried the followings - 36px for idpi, 48px for mdpi, 72px for hdpi, 96px for xhdpi, 144px for xxhdpi

I also tried restarting VS, rebuilding the entire solution, clearing cache and temp files.

I have checked the code sample. Do the changes below it would change the application icon.

Change the icon in MainActivity:

 Icon = "@drawable/logo"

Change the Application icon in Android Manifest:

在此处输入图片说明

Sceenshot:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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