问题描述
我想知道如何在Android Studio中更改启动器图标.
在应用程序的AndroidManifest.xml文件中查找<application>
标签.
此应用程序标签具有android:icon
属性,通常为@drawable/ic_launcher
.此处的值是启动器图标文件的名称.如果值为@drawable/ic_launcher
,则图标的名称为ic_launcher.png
.
在资源文件夹(res/mipmap-mdpi
,res/mipmap-hdpi
等)中找到此图标,然后将其替换.
关于mipmap资源的注释:如果启动器图标当前位于可绘制的文件夹(例如res/drawable-hdpi
)中,则应将其移动到mipmap等效项(例如res/mipmap-hdpi
). Android将更好地保留mipmap文件夹中可绘制对象的分辨率,以在启动器应用程序中显示. >
Android Studio注释:如果您使用的是Android Studio,则可以让Studio将绘图对象放置在适合您的位置.只需右键单击您的应用程序模块,然后单击新建-> 图像资产.
对于图标类型,如果您还想选择"Launcher Icons(仅旧版)" 用于平面PNG文件,请选择"Launcher Icons(自适应和旧版)" 为API 26+设备生成自适应图标.
I was wondering how to change the launcher icon in Android Studio.
Look in the application's AndroidManifest.xml file for the <application>
tag.
This application tag has an android:icon
attribute, which is usually @drawable/ic_launcher
.The value here is the name of the launcher icon file. If the value is @drawable/ic_launcher
, then the name of the icon is ic_launcher.png
.
Find this icon in your resource folders (res/mipmap-mdpi
, res/mipmap-hdpi
, etc.) and replace it.
A note on mipmap resources: If your launcher icon is currently in drawable folders such as res/drawable-hdpi
, you should move them to the mipmap equivalents (e.g. res/mipmap-hdpi
). Android will better preserve the resolution of drawables in the mipmap folder for display in launcher applications.
Android Studio note: If you are using Android Studio you can let studio place the drawables in the correct place for you. Simply right click on your application module and click New -> Image Asset.
For the icon type select either "Launcher Icons (Legacy Only)" for flat PNG files or "Launcher Icons (Adaptive and Legacy)" if you also want to generate an adaptive icon for API 26+ devices.
这篇关于如何在Android Studio中更改应用程序的启动器徽标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!