对于HDPI, XHDPI等,理想的启动器图标的大小应该是什么?我应该为图标创建9-Patch图像来自动缩放,还是创建单独的图标会更好?
当前回答
根据材质设计指南(这里,在“DP单元网格”下),你的产品图标的大小应该是48dp,填充为1dp,除了XXXHDPI的情况,填充应该是4dp。
所以,以像素为单位,大小是:
48 × 48 (mdpi),带有1dp填充 72 × 72 (hdpi),带有1dp填充 96 × 96 (xhdpi),带有1dp填充 144 × 144 (xxhdpi),带有1dp填充 192 × 192 (xxxhdpi), 4 dp填充
我建议避免使用VectorDrawable,因为一些启动器不支持它,但我认为WEBP应该是ok的,只要你有你的minSdk支持透明度(API 18及以上- Android 4.3)。
如果你在Play Store上发布内容,关于上传内容的要求如下(基于这里):
32位PNG(带alpha) 尺寸:512px * 512px 最大文件大小:1024KB
其他回答
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.
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。
我已经发布了一个脚本,从一个SVG图标文件生成PhoneGap应用程序的所有平台图标。如果您有现有的位图,我还提供了一些注释,可以帮助您从现有的位图生成SVG向量。这并不适用于所有位图,但可能适用于你的位图。
https://github.com/tohagan/phonegap-graphics
提供至少512px X 512px的图像,并使用这个工具: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
它将为您生成正确大小的所有图标,包括游戏商店的网页图像。
当Android Studio可以为我们生成图标时,不需要第三方工具。
File ->新建->镜像资产 然后选择启动器图标作为资产类型: 为图像文件选择高分辨率图像:
下一步->完成生成图标
最后,如果需要,更新AndroidManifest.xml中的android:图标名称字段。
推荐文章
- 改变开关的“开”色
- 以编程方式将EditText的输入类型从PASSWORD更改为NORMAL,反之亦然
- 如何在隐藏和查看密码之间切换
- 在Android上调整一个大的位图文件到缩放输出文件
- 如何更改Android版本和代码版本号?
- Android Studio突然无法解析符号
- 应用程序重新启动而不是恢复
- 如何设置整个应用程序在纵向模式?
- Android中文本的阴影效果?
- 以编程方式设置TextView的布局权重
- Android -如何覆盖“后退”按钮,所以它不完成()我的活动?
- 如何从通知点击发送参数到一个活动?
- 导航目标xxx对于这个NavController是未知的
- 使用ConstraintLayout均匀间距的视图
- 文件google-services错误。模块根文件夹中缺少Json。谷歌服务插件没有它就不能正常工作。