阅读更多

mdpi is the reference density -- that is, 1 px on an mdpi display is equal to 1 dip. The ratio for asset scaling is:

 

ldpi    | mdpi | tvdpi  | hdpi | xhdpi | xxhdpi | xxxhdpi

0.75    |    1    |   1.33  |  1.5   |     2     |      3     |    4

Although you don't really need to worry about tvdpi unless you're developing specifically for Google TV or the original Nexus 7 -- but even Google recommends simply using hdpi assets. You probably don't need to worry about xxhdpi either (although it never hurts, and at least the launcher icon should be provided at xxhdpi), and xxxhdpi is just a constant in the source code right now (no devices use it, nor do I expect any to for a while, if ever), so it's safe to ignore as well.

 

What this means is if you're doing a 48dip image and plan to support up to xhdpi resolution, you should start with a 96px image (144px if you want native assets for xxhdpi) and make the following images for the densities:

 

ldpi        | mdpi     | tvdpi      | hdpi      | xhdpi      | xxhdpi       | xxxhdpi

36 x 36  | 48 x 48 | 64 x 64  | 72 x 72 | 96 x 96   | 144 x 144 | 192 x 192

And these should display at roughly the same size on any device, provided you've placed these in density-specific folders (e.g. drawable-xhdpi, drawable-hdpi, etc.)

 

For reference, the pixel densities for these are:

 

ldpi  | mdpi  | tvdpi  | hdpi  | xhdpi  | xxhdpi  | xxxhdpi

120   | 160   | 213    | 240   | 320    | 480     | 640

更多相关文章

  1. Android(安卓)XMl写入
  2. 实现Android(安卓)ListView 自动加载更多内容
  3. Android下拉刷新和上拉加载更多
  4. Android(安卓)studio 下拉刷新,加载更多使用LoadingViewFinal
  5. 推荐阅读:Android开发者的博客
  6. Android(安卓)开发佳站
  7. 构建 Android(安卓)手机 RSS 阅读器
  8. Android源码阅读分析:从Activity开始(二)——加载布局
  9. 构建 Android(安卓)手机 RSS 阅读器

随机推荐

  1. Android(安卓)开发一定要看的15个实战项
  2. android左右滑动加载分页以及动态加载数
  3. Android序列化Serializable和Parcelable
  4. Android底层开发之旅—蓝牙系统分析
  5. android蓝牙BLE(三) —— 广播
  6. Android直播开发之旅(8):Android硬编解码
  7. :Android模拟器的基本操作
  8. 简述Android触摸屏手势识别
  9. Android输入系统解析及Native层模拟按键
  10. android Layout XML属性