我想知道如何改变在Android工作室的启动器图标。
当前回答
要更改应用程序图标,请转到您的res目录,右键单击mipmap文件夹,单击New > Image Asset。通过从菜单中单击图像资产,将打开一个资产工作室对话框,从源资产部分选择资产类型图像,从路径选择您想要的图像,然后单击下一步按钮,最后单击完成来更改图标。
其他回答
在清单文件中,在标签下面,会有类似的一行:
android:icon="drawable_resource_path"
将启动器图标放置在可绘制文件夹中,并写入其资源路径。
在应用程序的AndroidManifest.xml文件中查找<application>标记。
这个应用程序标签有一个android:icon属性,通常是@drawable/ic_launcher。 这里的值是启动器图标文件的名称。如果值为@drawable/ic_launcher,则图标的名称为ic_launcher.png。
在你的资源文件夹(res/ mimmap -mdpi, res/ mimmap -hdpi等)中找到这个图标并替换它。
关于mipmap资源的注意事项:如果你的启动器图标目前在可绘制文件夹中,例如res/drawable-hdpi,你应该将它们移动到mipmap的等效文件夹中(例如res/mipmap-hdpi)。Android将更好地保留mipmap文件夹中绘图的分辨率,以便在启动程序中显示。
Android Studio注意:如果你正在使用Android Studio,你可以让工作室在正确的位置为你放置绘图。只需右键单击您的应用程序模块,并单击新建->图像资产。
对于图标类型,对于平面PNG文件选择“启动器图标(仅Legacy)”,如果您还想为API 26+设备生成自适应图标,则选择“启动器图标(自适应和Legacy)”。
以下是我认为更适合Android Studio开发者的另一个解决方案:
Expand the project root folder in the Project View Right Click on the app folder In the Context Menu go to New->Image Asset In the pop up that appears select the the new logo you would like to have(image/clip art/text). If you were selecting the image radio button (as is the default choice), if you clicked on the 3-buttons to show the path tree to locate your .png image file, most probably you might not be seeing it, so drag it from the Windows Explorer (if Windows) and drop it in the tree, and it will appear and ready for being selected.
就是这样!你有一个新的标志为您的应用程序现在。
要在Android Studio中快速创建一组新的图标并更改启动器图标,您可以:
使用这个工具: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html 上传您首选的图像或图标(源文件)。 然后,该工具自动为ic_launcher.png文件创建一组不同分辨率的图标。 下载由工具创建的zip文件,解压所有内容(这将为所有不同的分辨率创建一个文件夹结构),然后替换项目res文件夹中的所有图标: < AndroidStudioProjectPath > \ app \ src \ \ res
打开项目文件夹\app\src\main\res\ mimmap -mdpi\ic_launcher.png
您将看到5个mipmap文件夹。将每个mipmap文件夹中的图标替换为所需的图标。
推荐文章
- 改变开关的“开”色
- 以编程方式将EditText的输入类型从PASSWORD更改为NORMAL,反之亦然
- 如何在隐藏和查看密码之间切换
- 在Android上调整一个大的位图文件到缩放输出文件
- 如何更改Android版本和代码版本号?
- Android Studio突然无法解析符号
- 应用程序重新启动而不是恢复
- 如何设置整个应用程序在纵向模式?
- Android中文本的阴影效果?
- 以编程方式设置TextView的布局权重
- Android -如何覆盖“后退”按钮,所以它不完成()我的活动?
- 如何从通知点击发送参数到一个活动?
- 导航目标xxx对于这个NavController是未知的
- 使用ConstraintLayout均匀间距的视图
- 文件google-services错误。模块根文件夹中缺少Json。谷歌服务插件没有它就不能正常工作。