Android 屏幕分辨率与尺寸

DisplayMetrics metrics=new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);

测量数据:

DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=391.885, ydpi=381.0} 型号:小米 Redmi Note3

DisplayMetrics{density=1.3312501, width=1280, height=736, scaledDensity=1.3312501, xdpi=188.148, ydpi=189.023} 型号:Lenovo TB3-850M

DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=428.625, ydpi=424.069} 型号:vivo X6SA

分析

DIP (Density Independent Pixel) ,

参考:
https://developer.android.com/guide/practices/screens_support.html

你可能感兴趣的:(Android 屏幕分辨率与尺寸)