尺寸类型
以下尺寸来自Android类DisplayMetrics下,描述摘自源码描述。
- densityDpi:The screen density expressed as dots-per-inch. May be either 120,160 or 240
- xdpi:The exact physical pixels per inch of the screen in the X dimension.
- ydpi:The exact physical pixels per inch of the screen in the Y dimension.
- widthPixels:The absolute width of the available display size in pixels.
- heightPixels:The absolute height of the available display size in pixels.
- scaledDensity:A scaling factor for fonts displayed on the display. This is the same as density, except that it may be adjusted in smaller increments at runtime based on a user preference for the font size.
真机测试
- 创维电视(Q60):xdpi: 159.895–ydpi:160.421-densityDpi:240-density:1.5-width:1920-height:1080
- 小米盒子(型号未知):xdpi: 160.0–ydpi:160.0-densityDpi:320-density:2.0-width:1920-height:1080
- 华为p30: xdpi: 422.03–ydpi:421.531-densityDpi:480-density:3.0-width:1080-height:2265
- vivo V1924A: xdpi: 365.76–ydpi:362.673-densityDpi:440-density:2.75-width:1080-height:2140