android studio 启动器,如何在Android Studio中更改应用程序的启动器徽标?

Here is another solution which I feel is more sensible for those working on 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).

That is it! You have a new logo for you app now.

Look in the application's AndroidManifest.xml file for the 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.

Here are my steps for the task:

Create PNG image file of size 512x512 pixels

In Android Studio, in project view, highlight a mipmap directory

In menu, go to File>New>Image Asset

Click Image Button in Asset type button row

Click on 3 Dot Box at right of Path Box.

Drag image to source asset box

Click Next (Note: Existing launcher files will be overwritten)

Click Finish

To quickly create a new set of icons and change the launcher icon in Android Studio, you can:

Use this tool:

https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html

to upload your preferred image or icon (your source file).

The tool then automatically creates a set of icons in all the different resolutions for the ic_launcher.png.

Download the zip-file created by the tool, extract everything (which will create a folder structure for all the different resolutions) and then replace all the icons inside your project res folder:

\app\src\main\res

664af3bee885c20c192f994589b05545.pnggo to AndroidManifest.xml and change the android:icon="@mipmap/ic_launcher" to android:icon="@mipmap/(your image name)"

suppose you have a image named telugu and you want it to be set as your app icon then change android:icon="@mipmap/telugu" and you have to copy and paste your image into mipmap folder thats it its so simple as i said

In the manifest file, under the tag, there will be a similar line:

android:icon="drawable_resource_path"

Place the launcher icon you want in drawable folder and write its resource path.

Go to AndroidManifest.xml

In the tag, look for android:icon tag.

Copy and paste your icon in drawable folder(available in res folder of your project).

Set the value of android:icon tag as

android:icon="@drawable/youriconname"

Voila! you are done. Save the changes and test.

We can replace the code in the AndroidManifest file in the application tag

android:icon="@drawable/logo"

Go to the manifest

and change

android:icon="@drawable/logo"

Make sure that the logo icon is present in the drawable.

Go to your project folder\app\src\main\res\mipmap-mdpi\ic_launcher.png

You will see 5 mipmap folders. Replace the icon inside of the each mipmap folder, with the icon you want.

I created my icons using this tool:

After I downloaded these (they were already pre named to ic_launcher, very useful!) I found the

mipmap ic_launcher folder under the res folder

and I replaced the pre icons with the ones I created. Reinstall your app, and you'll see your new icon!

Go To:

res > drawable > right click > show in folder > add desired logo

go to android manifest edit ICON tag under application tag use `"@drawable/nameOfImage"`

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值