【问题标题】:Round icon not showing on Marshmallow棉花糖上未显示圆形图标
【发布时间】:2019-08-31 21:26:57
【问题描述】:

我的测试设备是 Android 6.0。它为所有应用程序使用圆形图标(我的除外)。由于这是唯一的测试设备,而且我的手机没有使用圆形图标,我必须让它在测试设备上运行。

我正在尝试让它显示一个圆形图标,但到目前为止我没有成功。

我已将所有 ic_launcher_round 图片设置为不同的分辨率。我还为“ic_launcher_round.xml”文件创建了一个“app_icon_round”图片。 所有的 ic_launcher_round 图片都是合适的尺寸等等......我已经检查过很多次了。

ic_launcher_round.xml:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/app_icon_round" />
</adaptive-icon>

AndroidManifest.xml,:

<application
    ...
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    ...
</application>

我总是使用 Android Studio 安装它。我注意到当我在启动画面上工作时,我需要手动卸载应用程序,重新启动手机,然后通过 Android Studio 安装它才能注意到变化。

我想我错过了一些小事,但不知道是什么。我在网上看到的答案并没有提到我没有做的事情。

【问题讨论】:

标签: android icons android-manifest android-icons


【解决方案1】:

Android 6.0 设备将显示您的@mipmap/ic_launcher 图标。如果您希望您的启动器图标在 Android 6.0 上是圆形的,请将 @mipmap/ic_launcher 设为圆形。

android:roundIcon 仅在 Android 7.1 上使用,自适应图标仅在 Android 8.0+ 上使用。

【讨论】:

  • 谢谢,过了时限我会接受答案的。基本上我可以将圆形图标作为默认图标,但我不喜欢那样,因为那样它总是圆形的。以我的拙见,如果我必须在支持旧版本或新版本之间做出选择,我会选择新版本。
  • @InvaderZim:“但我不喜欢那样,因为那样它总是圆的”——没有什么能阻止你为不同的 Android 版本使用不同版本的 @mipmap/ic_launcher。跨度>
  • 哦,我不知道,非常感谢,这解决了我所有的问题:D
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-17
  • 1970-01-01
相关资源
最近更新 更多