Android Icon Sizes [duplicate]

感情迁移 提交于 2019-12-03 06:44:44
DeeV

The ratios are .75|1|1.33|1.5|2.|3.|4. (or 3:4:6:8:12:16) That is, for your 10x10px bitmap, the graphics would be

ldpi    - 10x10 * 0.75 = 7x7
mdpi    - 10x10 * 1    = 10x10
tvdpi   - 10x10 * 1.33 = 13x13
hdpi    - 10x10 * 1.5  = 15x15
xhdpi   - 10x10 * 2    = 20x20
xxhdpi  - 10x10 * 3    = 30x30
xxxhdpi - 10x10 * 4    = 40x40
morroko

I would create separate images for each one:

Res     Px     
ldpi    36 x 36
mdpi    48 x 48
hdpi    72 x 72
xhdpi   96 x 96
xxhdpi  144x144
xxxhdpi 192x192

Then just put each of them in the separate stalks of the drawable folder.

hi you can build launcher icons online by this link

http://android-ui-utils.googlecode.com/hg/asset-studio/dist/icons-launcher.html

browse your icons image file and edit it and download as zip

Generalized rule for pixel values to support multiple screen is based on a baseline configuration of your device screen density. Baseline for density 160 pixels , mdpi comes in this range. So by calculating dpi values you can put these values in different dimens.xml to support various devices. General formula is :

Result = Value(dpi) * device density(pi)/160(dpi)

So first check your device density first then according to above formula calculate the values for dimens.xml. For standard we generally assume that:

For mdpi density = 160, hdpi - 240, xhdpi - 320 , ldpi - 120

As in your case if value is 10*10 then the Result for different screen will be :

For ldpi:

Result = 10*120/160 = 7.5 , i.e 7 pixels

For mdpi:

Result = 10*160/160 = 10 pixels

For hdpi:

Result = 10*240/160 = 15 pixels

For xhdpi:

Result = 10*320/160 = 20 pixels

You can also refer to this http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/training/multiscreen/screendensities.html

According to the Android-Iconography guide, the icons should follow 2:3:4:6 scale ratios for different screen densities, medium, high, x-high, and xx-high respectively.

You can also check Android Design guide for iconography. http://developer.android.com/design/style/iconography.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!