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

发布于 2025-01-12 19:21:04 字数 937 浏览 4 评论 0原文

我正在开发 Xamarin.Android 应用程序,注意到应用程序图标在运行 Android 11 的小米 Poco F3 智能手机上看起来不正确。

图标的顶部、底部、左侧和右侧有一条非常细的白线。似乎使用了方形图标并将其剪切以适合圆形,但它并不完全适合。

请参阅左侧第二个具有蓝色背景的应用程序图标:

在此处输入图像描述

该应用程序正在使用应用程序图标的旧方法:

建议的图标尺寸:48 x 48 像素 (mdpi)、72 x 72 像素 (hdpi) 等等... 在其他设备(三星 Galaxy S5 (Android 6)、Pixel 2 (Android 9))上看起来也不错。

mipmap 文件夹:

“在此处输入图像描述”

MainActivity:

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

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

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

未安装第三方启动器。

有人经历过类似的事情吗?可以在不创建新图标的情况下修复它吗?

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.

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:

enter image description here

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)).

mipmap folders:

enter image description here

MainActivity:

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

Target version: Android 11.0 (API Level 30)

Minimum version: Android 4.1 (API Level 16)

No third party launcher installed.

Anyone experienced something similar? Can it be fixed without creating new icons?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

土豪 2025-01-19 19:21:04

小米红米 Note 8 Pro 也有类似问题。

由于某种原因 android studio 资源管理器没有创建 mipmap-anydpi-v26 文件夹。 (屏幕 1)

Res 屏幕

检查您是否有一个。

对我来说删除所有图标资源并创建新的帮助。 (不知道为什么,但重写它有错误。在此过程中丢失了一些)

Had similar issue on Xiaomi Redmi Note 8 Pro.

For some reason android studio resource manager didn't create mipmap-anydpi-v26 folder. (Screen 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)

歌入人心 2025-01-19 19:21:04

这是一个有趣的问题。您只需按照下面我的简单步骤操作即可。

1.右键单击“res”
2.新增-->图片资源

在此处输入图像描述

3.在 Asset Studio 窗口中,您将找到一个名为“缩放”的部分
就在“缩放”下方 -->调整大小。

在此处输入图像描述

现在您可以调整图标大小,这样就可以使白色薄层消失。我希望这会有所帮助谢谢。

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

enter image description here

3. On the Asset Studio window, you will find a section called "Scaling"
right below Scaling --> resize.

enter image description here

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文