question

JerryLipan-2008 avatar image
0 Votes"
JerryLipan-2008 asked WenyanZhang-MSFT edited

How to set new Icon in Xamarin Mobile Apps ?

Hi,

I'm a newbies in Xamarin App Development with Visual Studio. So far, I've this in Android

205859-screenshot-20220526-221359-one-ui-home.jpg

How to set new Icon for this SFA ?

Please help


dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered WenyanZhang-MSFT edited

Hello,

On Android platform, the Xamarin icon named icon.png is under mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi, mipmap-xxxhdpi folders now. An easy way to change the icon is to replace the icon.png : design a set of icons in different sizes, and put each icon into the corresponding folder, make sure each icon is named icon.png, then the old icon file will be replaced.
The launcher-foreground.png needs to be updated as well.

A set of six generalized densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi

If you change the icon file name, please update the name in icon.xml and icon_round.xml, and update the Icon reference in MainActivity.cs.

On iOS platform, refer to https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/app-icons?tabs=macos

Pay attention to uninstalling the app and delete obj/bin to check the effect of the new icon.

Best Regards,
Wenyan Zhang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.