link

ppi Pixel Per Inch 像素密度 物理参数 538
dpi Dot Per Inch 像素密度 软件指定的,可能人为修改,不同ppi的手机譬如430、440、450,系统能指定dpi都为480 640
dp/dip Density-independent Pixels 抽象单位 1 dp = 1 pixel, — in 160 dpi screen 1 dp = 4 pixels
density density = dpi /160 每 dp 占当前设备屏幕多少像素 4
sp scale-independent pixels specifying font sizes, so they will be adjusted for both the screen density and user’s preference.
mate 20 pro

inch, 1 inch = 2.54 centimeters, 就是和键盘的shift的按键差不多长度,但是稍微短一点 ppi等于或者约等于dpi

  1. +----------------+----------------+---------------+-------------------------------+
  2. | Density Bucket | Screen Density | Physical Size | Pixel Size |
  3. +----------------+----------------+---------------+-------------------------------+
  4. | ldpi | 120 dpi | 0.5 x 0.5 in | 0.5 in * 120 dpi = 60x60 px |
  5. +----------------+----------------+---------------+-------------------------------+
  6. | mdpi | 160 dpi | 0.5 x 0.5 in | 0.5 in * 160 dpi = 80x80 px |
  7. +----------------+----------------+---------------+-------------------------------+
  8. | hdpi | 240 dpi | 0.5 x 0.5 in | 0.5 in * 240 dpi = 120x120 px |
  9. +----------------+----------------+---------------+-------------------------------+
  10. | xhdpi | 320 dpi | 0.5 x 0.5 in | 0.5 in * 320 dpi = 160x160 px |
  11. +----------------+----------------+---------------+-------------------------------+
  12. | xxhdpi | 480 dpi | 0.5 x 0.5 in | 0.5 in * 480 dpi = 240x240 px |
  13. +----------------+----------------+---------------+-------------------------------+
  14. | xxxhdpi | 640 dpi | 0.5 x 0.5 in | 0.5 in * 640 dpi = 320x320 px |
  15. +----------------+----------------+---------------+-------------------------------+
  1. +---------+-------------+---------------+-------------+--------------------+
  2. | Unit | Description | Units Per | Density | Same Physical Size |
  3. | | | Physical Inch | Independent | On Every Screen |
  4. +---------+-------------+---------------+-------------+--------------------+
  5. | px | Pixels | Varies | No | No |
  6. +---------+-------------+---------------+-------------+--------------------+
  7. | in | Inches | 1 | Yes | Yes |
  8. +---------+-------------+---------------+-------------+--------------------+
  9. | mm | Millimeters | 25.4 | Yes | Yes |
  10. +---------+-------------+---------------+-------------+--------------------+
  11. | pt | Points | 72 | Yes | Yes |
  12. +---------+-------------+---------------+-------------+--------------------+
  13. | dp | Density | ~160 | Yes | No |
  14. | | Independent | | | |
  15. | | Pixels | | | |
  16. +---------+-------------+---------------+-------------+--------------------+
  17. | sp | Scale | ~160 | Yes | No |
  18. | | Independent | | | |
  19. | | Pixels | | | |
  20. +---------+-------------+---------------+-------------+--------------------+

屏幕适配方案

  • 限定符适配方案—reference
  • 今日头条适配方案-反射修正系统的density值—reference