开发者

Bitmap resources depending on screen densities

开发者 https://www.devze.com 2023-02-08 12:21 出处:网络
The Android documentation being the mess that it is, I have big problem understanding what sizes my icons should be for each of the densities. The ultra-lengthy article( http://developer.android.com/g

The Android documentation being the mess that it is, I have big problem understanding what sizes my icons should be for each of the densities. The ultra-lengthy article( http://developer.android.com/guide/practices/screens_support.html ) on supporting multiple-screen doesn't provide the information.

So I was going to just guess some sizes when I finally hit that this gem in the "providing ressources" article ( http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources ) :

开发者_开发知识库

There is thus a 3:4:6 scaling ratio between the three densities, so a 9x9 bitmap in ldpi is 12x12 in mdpi and 18x18 in hdpi.

Thing is they just introduced the xhdpi density.

So now what is the x in 3:4:6:x ??

EDIT : Added link as asked by commenter


It's in the page you linked to, but somewhat hidden in Table 1:

  • ldpi: 120 dpi
  • mdpi: 160 dpi
  • hdpi: 240 dpi
  • xhdpi: 320 dpi

So it's 3:4:6:8.

0

精彩评论

暂无评论...
验证码 换一张
取 消