Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change my App's icon in Xamarin.Forms using Visual Studio?

I'm new to Xamarin.Forms and I am finding it impossible to change the application's icon for my app.

I used a cross-platform template in VS2017. I changed all the icon files in @mipmap-XXXX. When I run in the emulator the app icon changes but not on my device.

Does anyone have a proven method for getting this working. I'm sure it's possible but I can't find any information that helps.

like image 347
Jason James Avatar asked Dec 31 '18 11:12

Jason James


1 Answers

If you're creating projects using the newest VS/Xamarin update, you should notice a folder in the Android project (under Resources) called mipmap-anydpi-v26, or similar. In this folder, you will find two XML files: icon.xml and icon_round.xml. If you open these files, you'll notice that they reference :

  • launcher_foreground - your icon image.
  • launcher_background - background color of your icon, mainly used for round icons.

When you are assigning the app icon and you reference icon, you are actually referencing the XML file, not the images. The XML file then retrieves the correct image size from the other mipmap folders.

like image 86
Tom Avatar answered Nov 14 '22 21:11

Tom