使用自适应图标时不显示旧图标 [英] Legacy icon does not show when using adaptive icon

查看:27
本文介绍了使用自适应图标时不显示旧图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用 android studio 中的 Image Asset Studio 将我的应用程序图标转换为与 android o 的自适应图标兼容

I just converted my app icon to be compatible with android o's adaptive icons using the Image Asset Studio in android studio

当我现在在运行 API 25 的设备上运行我的项目时,我得到默认的绿色 android 图标,而不是我的图标.

when I run my project now on my device running API 25 I get the default green android icon and not my icon.

这是我的清单

<application
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:allowBackup="false"
    android:roundIcon="@mipmap/ic_launcher_round"
    tools:replace="allowBackup"
    tools:ignore="GoogleAppIndexingWarning">

这些是图像资产工作室创建的文件

and these are the files the image asset studio created

这只是 Android Studio 的错误还是我遗漏了什么?

Is this just an Android Studio bug or did I miss something?

推荐答案

我遇到了同样的问题,通过将我的 mipmap-anydpi 目录重命名为 mipmap-anydpi-v26.

I had the same trouble, and solved it by renaming my mipmap-anydpi directory to mipmap-anydpi-v26.

显然 ic_launcher.xml 文件混淆了旧的 Android 版本,这将它隐藏在除 O 之外的所有版本中.无论如何,我的图标现在适用于所有版本(至少到 SDK 11).

Apparently the ic_launcher.xml file confuses older Android versions, and this hides it from all but O. At any rate, my icons now work on all versions (down to SDK 11, at least).

这篇关于使用自适应图标时不显示旧图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆