简体   繁体   English

如何去除Android应用程序图标周围的白线

[英]How to remove white lines around Android app icon

I am working on an Xamarin.Android app and noticed the app icon doesn't look right on a Xiaomi Poco F3 smartphone running Android 11.我正在开发 Xamarin.Android 应用程序,并注意到应用程序图标在运行 Android 11 的小米 Poco F3 智能手机上看起来不正确。

There is a very thin white line on top, bottom, left and right of the icon.图标的顶部、底部、左侧和右侧都有一条非常细的白线。 It seems like the square icon was used and cut to fit a circle but it doesn't fit entirely.似乎使用了方形图标并将其切割以适合圆形,但它并不完全适合。

See the second to the left app icon with the blue background:查看左侧第二个带有蓝色背景的应用程序图标:

在此处输入图像描述

The app is using the legacy approach for app icons:该应用程序对应用程序图标使用旧方法:

Icon dimensions are as recommended: 48 x 48 pixels (mdpi), 72 x 72 pixels (hdpi) and so on... and look fine on other devices (Samsung Galaxy S5 (Android 6), Pixel 2 (Android 9)).推荐的图标尺寸:48 x 48 像素 (mdpi)、72 x 72 像素 (hdpi) 等等……在其他设备上看起来不错(三星 Galaxy S5 (Android 6)、Pixel 2 (Android 9))。

mipmap folders: mipmap 文件夹:

在此处输入图像描述

MainActivity:主要活动:

[Activity(
    ...
    MainLauncher = true,
    Icon = "@mipmap/ic_launcher",
    RoundIcon = "@mipmap/ic_launcher_round",
    ...
    )]

Target version: Android 11.0 (API Level 30)目标版本:Android 11.0(API 级别 30)

Minimum version: Android 4.1 (API Level 16)最低版本:Android 4.1(API 级别 16)

No third party launcher installed.没有安装第三方启动器。

Anyone experienced something similar?有人经历过类似的事情吗? Can it be fixed without creating new icons?可以在不创建新图标的情况下修复它吗?

That is an interesting question.这是一个有趣的问题。 You just have to follow my simple steps down below.您只需要按照下面的简单步骤进行操作即可。

1. Right-click on the "res" 2. New --> Image Asset 1.右键单击“res” 2.新建-->图像资源

在此处输入图像描述

3. On the Asset Studio window, you will find a section called "Scaling" right below Scaling --> resize. 3. 在 Asset Studio 窗口中,您会在 Scaling --> resize 下方找到一个名为“Scaling”的部分。

在此处输入图像描述

Now you can resize your icon and that is how you can make a white thin layer disappear.现在您可以调整图标的大小,这就是使白色薄层消失的方法。 I hope this might help Thank you.我希望这可能会有所帮助谢谢。

Had similar issue on Xiaomi Redmi Note 8 Pro.小米红米 Note 8 Pro 也有类似问题。

For some reason android studio resource manager didn't create mipmap-anydpi-v26 folder.由于某种原因,android studio 资源管理器没有创建 mipmap-anydpi-v26 文件夹。 (Screen 1) (画面 1)

Res screen分辨率屏幕

Check if you have one.检查你是否有一个。

For me deleting all icon res and creating new helped.对我来说,删除所有图标资源并创建新的帮助。 (Don't know why, but rewriting it is buggy. Some are missing during this procedure) (不知道为什么,但重写它是错误的。在此过程中缺少一些)

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

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