不久前,我制作了一个简单的Android应用程序——一个上传数据的共享意图处理程序。
现在我为它设计了一个新的SVG图标,在项目中导入为矢量图形,然后用InkScape转换为一系列PNG,并替换了项目中的所有PNG。
应用程序现在显示为上的新图标
- Android 4.3(SGS3,库存固件(
- 和Android 7.1(SGS2,LineageOS(
但Android 11(API 30级,三星Galaxy A50,库存固件(仍然显示旧图标。
应用程序中已经没有默认图标(带耳朵的绿色安卓头像(可以驻留的地方了
当某个期望的资源丢失时,是否会显示默认图标?
我用以下文件中的新图像替换了图像:
- app\src\main\res\drawable-v24\ic_launcher_forregound.xml
- app\src\main\res\mipmap hdpi\ic_launcher.png
- app\src\main\res\mipmap mdpi\ic_launcher.png
- app\src\main\res\mipmap xhdip\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_ound.png
- app\src\main\res\mipmap mdpi\ic_launcher_ound.png
- app\src\main\res\mipmap xhdip\ic_launcher_ound.png
- app\src\main\res\mipmap xxhdpi\ic_launcher_ound.png
- app\src\main\res\mipmap xxxhdpi\ic_launcher_ound.png
我注意到appsrcmainresdrawable
文件夹中没有ic_launcher_foreground.xml
,只有appsrcmainresdrawable-v24
。这正常吗?
我的appsrcmainresmipmap-anydpi-v26ic_launcher.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/ic_launcher_foreground" />
</adaptive-icon>
当我在Android Studio中按住Ctrl键单击@drawable/ic_launcher_foreground
时,它会引导我进入appsrcmainresdrawable-v24ic_launcher_foreground.xml
。
您应该尝试从添加图标
res->可绘制->右键单击->新->添加图像资产->启动器图标
在那里更改你的启动器图标,它应该随处可见。