圆形图标未显示在棉花糖上

Inv*_*Zim 3 icons android android-manifest android-icons

我的测试设备是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>
Run Code Online (Sandbox Code Playgroud)

AndroidManifest.xml,:

<application
    ...
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    ...
</application>
Run Code Online (Sandbox Code Playgroud)

我总是使用 Android Studio 安装它。我注意到当我在启动屏幕上工作时,我需要手动卸载应用程序,重新启动手机,然后通过 Android Studio 安装它以注意更改。

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

Com*_*are 5

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`。 (2认同)