'Xamarin - Android Icon too small
I have created the properly sized png files with the online tool (android asset studio) and placed them in the appropriate folders (drawable, drawable-hdpi, drawable-xhdpi and so on) and renamed them al with the same name Icon.png.
then I edited the Main activity like this:
[Activity(Label = "GShare", Icon = "@drawable/Icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
The app shows up, but it is smal.. I have my icon drawed at about the size of the letter in the gmail app-icon. I also tried putting the big image in all the folders, but it makes no difference. I have foudn several posts here, but they all point to generating the asset with the site i mentioned above, and it is what I did..
How can I solve this Icon sizing issue?
EDIT:
Problem is still not solved.. please have a look at the screenshot. first icon lower row, and icon in the minimized window... I'd expect the image to fill the space. the result should be that the white circle is slightly smaller than the Icon canvas circle, and that the blue background is slightly visible aound the white circle..
The icons I saved are these:
- Inside Drawable: 512 x 512
- hdpi: 72 x 72
- xhdpi: 96 x 96
- xxhdpi: 144 x 144
- xxxhdpi: 192 x 192
I tried various sizes inside drawable and with no changing result I sticked with the biggest.
and this is how it should look like:
Solution 1:[1]
Have you tried this kind of mipmap:
And then we could define the custom foreground and background images there:
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
We could create a new Android project to see its format.
Solution 2:[2]
Wanted to follow up for those still struggling on this. Apart from the correct recommendation to use themipmap-anydpi-v26 structure, it appears that unless you remove the Icon designator from the Activity attributes, it will not read the folder correctly.
[Activity(Label = "GShare", Icon = "@drawable/Icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
Needs to be changed to
[Activity(Label = "GShare", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
If you do this, Android 11 will use the structure correctly.
Solution 3:[3]
The icon sizes you are using are correct. Launcher icons generator puts there a small padding, that is the reason for smaller icons. Please refer this reason for small padding
Solution 4:[4]
I have had this once before and somehow I resolved it without understanding what the problem was, and it happened again today. This time I think I understood what the cause of this issue was: the icon maker did not make perfectly square icons for all icons, some icons were 1pixel out.. so 192x191, fixing this problem seemed to fix the issue described on the page.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ax1le |
| Solution 2 | Dave Friedel |
| Solution 3 | George Isaac |
| Solution 4 | Robert Bertora - KAMOHA TECH |



