对于HDPI, XHDPI等,理想的启动器图标的大小应该是什么?我应该为图标创建9-Patch图像来自动缩放,还是创建单独的图标会更好?
当前回答
自适应的图标
从Android 8.0开始,有自适应图标,由两个独立的层组成。两层都是108 x 108 dp。
(图片来自Android文档)
大小
如果你支持Android 8.0以下的版本,你仍然需要包含旧的尺寸(48dp)。我在下面用红色标记了每个分辨率的像素大小。
不要用手做
我想如果你愿意,你可以亲手做这些,但我不得不说,我做这些的日子已经结束了。Android Studio 3.0 Asset Studio非常好,可以为你生成所有这些。你所要做的就是提供一个足够大的前景和背景图像。(我使用1024 x 1024像素的图像)。
打开资产工作室,去文件>新建>图像资产。
其他回答
提供至少512px X 512px的图像,并使用这个工具: https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
它将为您生成正确大小的所有图标,包括游戏商店的网页图像。
我会为每一个创建单独的图像:
LDPI should be 36 x 36.
MDPI should be 48 x 48.
TVDPI should be 64 x 64.
HDPI should be 72 x 72.
XHDPI should be 96 x 96.
XXHDPI should be 144 x 144.
XXXHDPI should be 192 x 192.
然后把它们分别放在可绘制文件夹的茎中。
当你将应用上传到谷歌Play Store时,你还需要提供一个大版本的图标,这应该是WEB 512 x 512。这是如此之大,以至于谷歌可以重新缩放到任何大小,以便在谷歌Play Store中宣传你的应用程序,而不添加像素到你的标志。
基本上,所有其他图标都应该与“基线”图标成比例,MDPI为48 x 48。
LDPI is MDPI x 0.75.
TVDPI is MDPI x 1.33.
HDPI is MDPI x 1.5.
XHDPI is MDPI x 2.
XXHDPI is MDPI x 3.
XXXHDPI is MDPI x 4.
这一切都在Android开发者网站的图标页面上进行了解释: http://developer.android.com/design/style/iconography.html(截至2014年) 材料设计原则:https://material.io/design/iconography/product-icons.html 游戏商店指南:https://developer.android.com/distribute/google-play/resources/icon-design-specifications
自适应的图标
从Android 8.0开始,有自适应图标,由两个独立的层组成。两层都是108 x 108 dp。
(图片来自Android文档)
大小
如果你支持Android 8.0以下的版本,你仍然需要包含旧的尺寸(48dp)。我在下面用红色标记了每个分辨率的像素大小。
不要用手做
我想如果你愿意,你可以亲手做这些,但我不得不说,我做这些的日子已经结束了。Android Studio 3.0 Asset Studio非常好,可以为你生成所有这些。你所要做的就是提供一个足够大的前景和背景图像。(我使用1024 x 1024像素的图像)。
打开资产工作室,去文件>新建>图像资产。
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.
不要为启动器图标创建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)
推荐文章
- 改变开关的“开”色
- 以编程方式将EditText的输入类型从PASSWORD更改为NORMAL,反之亦然
- 如何在隐藏和查看密码之间切换
- 在Android上调整一个大的位图文件到缩放输出文件
- 如何更改Android版本和代码版本号?
- Android Studio突然无法解析符号
- 应用程序重新启动而不是恢复
- 如何设置整个应用程序在纵向模式?
- Android中文本的阴影效果?
- 以编程方式设置TextView的布局权重
- Android -如何覆盖“后退”按钮,所以它不完成()我的活动?
- 如何从通知点击发送参数到一个活动?
- 导航目标xxx对于这个NavController是未知的
- 使用ConstraintLayout均匀间距的视图
- 文件google-services错误。模块根文件夹中缺少Json。谷歌服务插件没有它就不能正常工作。