Background Color for Launcher Icons

Nathan Sokalski 4,111 Reputation points
2022-01-15T22:32:03.893+00:00

This is probably a very simple question, but I can't quite seem to find the answer. I want to change the background of the launcher icons for my app (ic_launcher/ic_launcher_round). All I need is a solid color. I have found multiple articles that use ic_launcher.xml & ic_launcher_round.xml files containing an adaptive-icon which contains a background in the mipmap-anydpi-v26 folder. However, I do not want a mipmap-anydpi-v26 folder because my app will not be used by v26 devices. All the step-by-step tutorials I have found use Android Studio, and do not show the code it creates. Is there any way to specify a launcher icon background color with Xamarin.Android & Visual Studio?

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-01-17T03:14:32.247+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    I do not want a mipmap-anydpi-v26 folder because my app will not be used by v26 devices.

    mipmap-anydpi-v26 is used in API 26 or later. Android 8.0 or later must create alternative drawable resources in app in res/mipmap-anydpi-v26/ic_launcher.xml

    Is there any way to specify a launcher icon background color with Xamarin.Android & Visual Studio?

    Xamarin.Android do not have doc to change the launcher icon background color. But have doc to change the icon.

    If you want to do it, I recommend you to using following way to change it.

    Open the mipmap-anydpi-v26, open the icon.xml and the icon_round.xml, check the value of <background /> tag, for example, my <background android:drawable="@color/launcher_background" /> , launcher_background value store in the colors.xml(Open your android project, find the Resources folder, open the values, find the colors.xml file ).

    Change value of the launcher_background, this background color of icon will be changed.

       <color name="launcher_background">#00FFFF</color>  
    

    Best Regards,

    Leon Lu


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.