计算屏幕高度,宽度代码(Activity中)
DisplayMetrics outMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(outMetrics); float mScreenHeight = outMetrics.heightPixels;
时间: 2024-10-21 10:38:34
计算屏幕高度,宽度代码(Activity中)
DisplayMetrics outMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(outMetrics); float mScreenHeight = outMetrics.heightPixels;