不久前,我制作了一个简单的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_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 \
文件夹中没有ic_launcher_foreground.xml
,只有在app \ src \ main \ res \ drawable-v24 \
中才有。这正常吗?
我的app \ src \ main \ res \ mipmap-anydpi-v26 \ ic_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
时,它会带我到app\src\main\res\drawable-v24\ic_launcher_foreground.xml
。
android:roundIcon
和android:icon
这两个条目下分别有什么内容? - Stachu@drawable/ic_launcher_background
和@drawable/ic_launcher_foreground
文件时,您会看到哪个标志或图像? - Vishal Beepapp\src\main\res\drawable-v24\ic_launcher_foreground.xml
文件中它是什么样子的? - Vishal Beep