对于HDPI, XHDPI等,理想的启动器图标的大小应该是什么?我应该为图标创建9-Patch图像来自动缩放,还是创建单独的图标会更好?
当前回答
当Android Studio可以为我们生成图标时,不需要第三方工具。
File ->新建->镜像资产 然后选择启动器图标作为资产类型: 为图像文件选择高分辨率图像:
下一步->完成生成图标
最后,如果需要,更新AndroidManifest.xml中的android:图标名称字段。
其他回答
我已经发布了一个脚本,从一个SVG图标文件生成PhoneGap应用程序的所有平台图标。如果您有现有的位图,我还提供了一些注释,可以帮助您从现有的位图生成SVG向量。这并不适用于所有位图,但可能适用于你的位图。
https://github.com/tohagan/phonegap-graphics
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图标需要5种不同屏幕像素密度的大小。低分辨率的图标是自动从基线创建的。
mdpi (Baseline): 160 dpi 1×
hdpi: 240 dpi 1.5×
xhdpi: 320 dpi 2×
xxhdpi: 480 dpi 3×
xxxhdpi: 640 dpi 4× (launcher icon only)
启动器图标(.Png)
48 × 48 (mdpi)
72 × 72 (hdpi)
96 × 96 (xhdpi)
144 × 144 (xxhdpi)
192 × 192 (xxxhdpi)
512 × 512 (Google Play store)
操作栏,对话框和标签图标
24 × 24 area in 32 × 32 (mdpi)
36 × 36 area in 48 × 48 (hdpi)
48 × 48 area in 64 × 64 (xhdpi)
72 × 72 area in 96 × 96 (xxhdpi)
96 × 96 area in 128 × 128 (xxxhdpi)*
通知图标
22 × 22 area in 24 × 24 (mdpi)
33 × 33 area in 36 × 36 (hdpi)
44 × 44 area in 48 × 48 (xhdpi)
66 × 66 area in 72 × 72 (xxhdpi)
88 × 88 area in 96 × 96 (xxxhdpi)*
小的上下文图标
16 × 16 (mdpi)
24 × 24 (hdpi)
32 × 32 (xhdpi)
48 × 48 (xxhdpi)
64 × 64 (xxxhdpi)*
xxxhdpi的大小只需要启动器图标支持多屏幕官方网站说。
不要为启动器图标创建9个补丁的图像。你必须为每一个单独的图像。
LDPI - 36 x 36
MDPI - 48 x 48
HDPI - 72 x 72
XHDPI - 96 x 96
XXHDPI - 144 x 144
XXXHDPI - 192 x 192.
WEB - 512 x 512 (Require when upload application on Google Play)
注意:WEB(512 x 512)图像使用时,你上传你的android应用程序在市场。
|| Android应用图标大小||
所有设备
hdpi=281*164
mdpi=188*110
xhdpi=375*219
xxhdpi=563*329
xxxhdpi=750*438
48 × 48 (mdpi)
72 × 72 (hdpi)
96 × 96 (xhdpi)
144 × 144 (xxhdpi)
192 × 192 (xxxhdpi)
512 × 512 (Google Play store)
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。
推荐文章
- Android M权限:对shouldShowRequestPermissionRationale()函数的使用感到困惑
- 为什么构建类型与产品风味不同?
- 我如何在一个片段中访问getSupportFragmentManager() ?
- 调试在哪里。Android Studio中的密钥存储库
- 从资产中读取文件
- 在不活动的地方调用getLayoutInflater()
- 设置Android布局元素的背景颜色
- 错误:'keytool'不能被识别为内部或外部命令、可操作程序或批处理文件
- 在应用程序本身中更改Locale
- apk (.apk)和应用程序包(.aab)的区别
- 如何设置超时在改造库?
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- TextView的字体大小在Android应用程序改变字体大小从本机设置
- 如何模拟Android杀死我的进程
- 禁用EditText闪烁光标