简体   繁体   English

Android启动器图标会进入我的图标图像

[英]Android launcher icon crops into my icon image

I build my Android app with VS2017 Xamarin, but I'm not sure that has anything to do with my problem. 我使用VS2017 Xamarin构建我的Android应用程序,但我不确定这与我的问题有什么关系。 I have built an app icon (PNG) that looks like this: 我已经构建了一个应用程序图标(PNG),如下所示:

在此输入图像描述

But when I launch my app in an Android emulator, it always crops out some of my icon, thusly: 但是当我在Android模拟器中启动我的应用程序时,它总会裁掉我的一些图标,因此:

在此输入图像描述

Notice that a bit of the truck tires and truck top get cropped out. 请注意,一些卡车轮胎和卡车顶部被裁掉了。 But this makes no sense because as you can see in photoshop, there is plenty of empty space between the truck icon and the edges of the square. 但这没有任何意义,因为正如你在photoshop中看到的那样,卡车图标和广场边缘之间有很多空的空间。 I want that space/margin to be preserved inside the icon, and not so aggressively cropped. 我希望将空间/边距保留在图标内,而不是如此积极地裁剪。

在此输入图像描述

I keep adding more and more space, but something (Android OS? Xamarin compiler? VS2017?) seems to be ignoring the margin/space and trying to aggressively crop right up to my icon. 我不断添加越来越多的空间,但是某些东西(Android OS?Xamarin编译器?VS2017?)似乎忽略了边距/空间并试图积极地裁剪到我的图标。

How can I solve this? 我怎么解决这个问题?

It's because your app is trying to look for a Round Icon file as you can see in this Microsoft blog post . 这是因为您的应用程序正在尝试查找圆形图标文件,您可以在此Microsoft博客文章中看到。 The easiest way to solve all your Icon issues for Android, including the pesky adaptive icons, is to use Android Studio. 解决Android所有Icon问题的最简单方法,包括讨厌的自适应图标,就是使用Android Studio。 You just install the free application (Windows/Mac) and then 您只需安装免费应用程序(Windows / Mac)

  1. Open the Android Studio, and create a blank project. 打开Android Studio,创建一个空白项目。 Then right click on the resources folder of the project and add an “Image Asset”. 然后右键单击项目的resources文件夹并添加“Image Asset”。
  2. In there, add the image, and then resize the image appropriately. 在那里,添加图像,然后适当调整图像大小。 Press OK. 按确定。
  3. Reveal the file in Finder/Explorer and Migrate all the files and folders to your existing project in Visual Studio. 在Finder / Explorer中显示文件,并将所有文件和文件夹迁移到Visual Studio中的现有项目。
  4. For rounded icons to work, you might have to make changes to the manifest file, or what ever file in the app you set the icon image name, and add an attribute of rounded-icon like in the article 要使圆形图标起作用,您可能必须更改清单文件,或者在应用程序中设置图标图像名称的文件,并添加圆形图标的属性,如文章中所示
  5. Test it & it should work 测试它应该工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM