Android Icon Sizes [duplicate]

爷,独闯天下 提交于 2019-12-04 11:09:47

问题


I know there are guidelines for creating icons for specific areas in Android (Tab, List, etc.) and how you would size them according to ldpi, mdpi, hdpi etc.

Are there any rules on how to scale other in-app icons?

I've got a 'tiny' icon of 10x10 px which I am using on my mdpi dev phone, what would be the scaling rules to create ldpi, hdpi & xhdpi versions of that icon?

Thanks

Dave


回答1:


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



回答2:


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.




回答3:


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




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/12117023/android-icon-sizes

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