对于HDPI, XHDPI等,理想的启动器图标的大小应该是什么?我应该为图标创建9-Patch图像来自动缩放,还是创建单独的图标会更好?


当前回答

I had the same problem but then realized the arrangement of my icon graphic within the square allowed (512 x 512 in my case) was not maximized. So I rotated the image and was able to scale it up to fill the corners better. Then I right clicked on my res folder in my project in Android Studio, then choose New then Image Asset, it took me through a wizard where I got to select my image file to use. Then if you check the box that says "Trim surrounding blank space", it makes sure all edges, that are able, touch the sides of your square. These steps got it much bigger than the original.

其他回答

你可以直接在android studio中创建图标。你需要遵循的步骤是:

1.右击Res->New->图像资产

2.将资产类型更改为图像。

3.从本地磁盘加载映像

4.你可以选择修剪,改变填充和添加背景也。如果需要,可以更改值。

5.单击Next - > Finish。

该图像将自动添加到mimmap -mdpi, mimmap -hdpi, mimmap -xhdpi, mimmap -xxhdpi, mimmap -xxxhdpi,如果您选择启动器图标或mimmap -xxxhdpi 如果您选择其他图标选项,则可绘制mdpi,可绘制hdpi,可绘制xhdpi,可绘制xxhdpi,可绘制xxxhdpi。

LDPI应该是36 x 36。

MDPI 48×48。

电视DPI 64 x 64。

HDPI 72 x 72。

XHDPI 96 x 96。

XXHDPI 144 x 144。

XXXHDPI 192 x 192。

用于谷歌Play Store应用程序提交的启动图像和斜杠图像大小

高分辨率图标。PFB表为所需尺寸 32位PNG(带alpha),尺寸:512px * 512px,最大文件大小:1024KB

所需的启动图标和飞溅图像大小

总体上至少需要2张截图(每种类型最多8张截图,类型包括“手机”,“7英寸平板电脑”和“10英寸平板电脑”) JPEG或24位PNG(无alpha),最小尺寸:320px,最大尺寸:3840px,样本尺寸:320 x 480,480 x 800,480 x 854,1280 x 720, 1280 x 800 24位PNG或JPEG

@MartinVonMartinsgrün提到现在有更好的工具,然后断言生成器在android工作室

应用图标(工具栏,ActionBar, drawablleft等)使用: http://romannurik.github.io/AndroidAssetStudio/icons-actionbar.html

对于启动器(应用程序图标)使用: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html

但是这里有一些技巧和方法来获得更好的图标和启动器图标的分辨率。

第一步:

首先访问https://materialdesignicons.com并选择你的图标。或者如果你的图标分辨率不错,那就跳过这一步。点击想要的图标,然后点击“高级导出”,它会打开一个如下图所示的窗口

然后点击“图标”生成图标(.png)。诀窍是为高分辨率设备生成尽可能大的图标,工具可以处理小设备的所有问题,但如果你使用小图标,在为高端设备生成图标时,你就会失去图标的分辨率。

第二步:

然后进入工具页面,上传图标

如果你想给图标上色,点击“自定义”。无论你上传什么颜色的图标,通过使用自定义你可以生成任何你想要的颜色。 然后选择一个名称,点击“下载。zip”。这将下载大多数常见分辨率的带有图标的.zip文件。你可以复制和粘贴res文件夹在你的应用程序项目文件夹,你会看到图标在可绘制部分。

提供至少512px X 512px的图像,并使用这个工具: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html

它将为您生成正确大小的所有图标,包括游戏商店的网页图像。