首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >删除新Android上的旧应用程序图标

删除新Android上的旧应用程序图标
EN

Stack Overflow用户
提问于 2022-08-30 13:01:36
回答 2查看 221关注 0票数 2

不久前,我制作了一个简单的Android应用程序--一个上传数据的共享意图处理程序。

现在我为它设计了一个新的SVG图标,作为矢量图形导入到项目中,然后用InkScape转换成一系列的PNG,并替换了项目中的所有PNG。

该应用程序现在显示在新图标上。

  • Android4.3 (SGS3,Stock )
  • 和Android7.1 (SGS2,LineageOS)

但是Android11 (API等级30,三星Galaxy A50,股票固件)仍然显示出旧的图标。

应用程序中不再有默认图标(带耳朵的绿色android头)可以驻留的地方了!

可能是默认的图标显示时,某些预期的资源是简单地丢失?

我在以下文件中用新的图像替换了图像:

  • app\src\main\res\drawable-v24\ic_launcher_foreground.xml
  • app\src\main\res\mipmap-hdpi\ic_launcher.png
  • app\src\main\res\mipmap-mdpi\ic_launcher.png
  • app\src\main\res\mipmap-xhdpi\ic_launcher.png
  • app\src\main\res\mipmap-xxhdpi\ic_launcher.png
  • app\src\main\res\mipmap-xxxhdpi\ic_launcher.png
  • app\src\main\res\mipmap-hdpi\ic_launcher_round.png
  • app\src\main\res\mipmap-mdpi\ic_launcher_round.png
  • app\src\main\res\mipmap-xhdpi\ic_launcher_round.png
  • app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png
  • app\src\main\res\mipmap-xxxhdpi\ic_launcher_round.png

我注意到app\src\main\res\drawable\文件夹中没有app\src\main\res\drawable\,只有app\src\main\res\drawable-v24\中没有。这是正常的吗?

我的app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml文件看起来如下:

代码语言:javascript
复制
<?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/ic_launcher_foreground" />
</adaptive-icon>

当我在Android中点击@drawable/ic_launcher_foreground时,它会引导我进入app\src\main\res\drawable-v24\ic_launcher_foreground.xml

EN

回答 2

Stack Overflow用户

发布于 2022-08-30 13:11:22

您应该尝试从

->可绘图->右键单击->新->添加图像资产->启动器图标

改变你的发射图标在那里,它应该是正确的,到处可见。

票数 0
EN

Stack Overflow用户

发布于 2022-09-09 03:32:53

尝试将ic_launcher.xml文件更改为

代码语言:javascript
复制
<?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/ic_launcher_foreground" />
</adaptive-icon>

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/ic_launcher_background" />
    <foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>

adaptive-icon只在Android8 (SDK 26)和更高版本上使用,所以运行Android11的设备引用该文件,而运行较旧版本的Android的设备则不是。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73542912

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档