What package to download for material design icons?

这一生的挚爱 提交于 2019-12-06 02:30:00

问题


If I go to https://design.google.com/icons/ and I select an icon to download, it gives me the option of downloading the 18dp, 24dp, 36dp, or 48dp version. I downloaded the 24dp package and it came with the hdpi, mdpi, xhdpi, xxhdpi, and xxxhdpi images. So I'm not sure what the difference is from downloading the other packages of 18dp, 36dp, or 48dp. Does anyone know the difference? What would be the best one to download to have the best compatibility across the majority of android devices?


回答1:


So I'm not sure what the difference is from downloading the other packages of 18dp, 36dp, or 48dp.

If you download 24dp icon package it will contain folowing images:

  • 24x24px mdpi (1x)
  • 36x36px hdpi (1.5x)
  • 48x48px xhdpi (2x)
  • 72x72px xxhdpi (3x)
  • 96x96px xxxhdpi (4x)

All of these will produce a 24dp image on screens with varying DPI. It works in a similar fashion with other base sizes.

Which size to get?

Toolbars icons are generally 24dp.

Notification icons are 24dp.

A default button is 36dp tall (plus 6dp on top and bottom making it 48dp in total) so I wouldn't go past 36dp for an icon. Anything beyond that would stretch the button.




回答2:


The 18dp, 24dp, 36dp and 48dp are the optimal size of the icons. If you were to add those icon in ImageView and did wrap_content for height or width they would be 18, 24, 36 or 48dp respectivley. Which means they look best for that width and height.

Now hdpi, mdpi, xhdpi, xxhdpi, and xxxhdpi are for supporting multiple devices with different resolutions. If you want more information about each of them checkout http://developer.android.com/guide/practices/screens_support.html




回答3:


Its mostly to support multiple devices and resolution ! higher resolution(dpi) icons would look good on devices ! low resolution images look distorted.

you check this link and hope this will clarify some of your doubts.



来源:https://stackoverflow.com/questions/35506714/what-package-to-download-for-material-design-icons

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