标签:结果 and 输出 roi star zhang efault 1.5 sources
private void get1() { Resources resources = this.getResources(); DisplayMetrics dm = resources.getDisplayMetrics(); int width = dm.widthPixels; int height = dm.heightPixels; Log.d("方法1", width + " , " + height); } private void get2() { WindowManager manager = this.getWindowManager(); DisplayMetrics outMetrics = new DisplayMetrics(); manager.getDefaultDisplay().getMetrics(outMetrics); int width = outMetrics.widthPixels; int height = outMetrics.heightPixels; Log.d("方法2", width + " , " + height); }
输出结果一致:
标签:结果 and 输出 roi star zhang efault 1.5 sources
原文地址:https://www.cnblogs.com/rianbowymail/p/8947580.html