maui appicon strange scaling on android

yueyinqiu 21 Reputation points
2022-09-01T14:33:51.107+00:00

Someone else have the same question here but no answers, so I created a repository to make it more clear.

Have I misused it or it's a true problem? Thanks in advance.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,869 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,471 Reputation points Microsoft Vendor
    2022-09-02T02:57:07.843+00:00

    Hello,

    You could find the following content from this documentation: Change a .NET MAUI app icon.

    Adaptive launcher icons are composed icons, using a background layer and a foreground layer, and an optional scaling value. For more information, see the Composed icon section. If the composed icon is defined, by specifying the ForegroundFile attribute, an adaptive launcher icon will be generated. The following XML demonstrates defining an icon that is used as an adaptive launcher icon:

       <ItemGroup>  
           <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" Color="#512BD4" />  
       </ItemGroup>  
    

    Therefore, you could use the <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundScale="0.4" Color="#fff" /> for Android platform to set the same effect as Xamarin.Android.

    Best Regards,

    Alec Liu.


    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful