[英]Using vector drawable as Android app icon
After creating an Android Studio 'Phone and Tablet' project using Material3 for Jetpack Compose, there appears to be a superfluous amount of image files created, despite the minimum API being 30 (Android 11).在使用 Material3 for Jetpack Compose 创建 Android Studio“手机和平板电脑”项目后,尽管最低 API 为 30(Android 11),但似乎创建了过多的图像文件。 Why in the
mipmap
folder has a whole bunch of raster images been generated, when for years, developers have been encouraged to use vector drawables for their app icons?为什么在
mipmap
文件夹中生成了一大堆光栅图像,而多年来,开发人员一直被鼓励在他们的应用程序图标中使用矢量可绘制对象? Even the XML files seem to be in a folder for API 26. Is that really necessary when an app targets API 30?甚至 XML 文件似乎都在 API 26 的文件夹中。当应用程序以 API 30 为目标时,这真的有必要吗? What should be done with the files in the
ic_launcher
and ic_launcher_round
folders ending in .webp
?应该如何处理以 .webp 结尾的
ic_launcher
和ic_launcher_round
文件夹中的.webp
?
AndroidManifest.xml AndroidManifest.xml
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApp"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.MyVectorApp">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
'Project' pane in Android Studio Android Studio 中的“项目”窗格
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.