DisplayMetrics用来获取屏幕的宽高

DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
		
widthMetrics = dm.widthPixels;
heightMetrics = dm.heightPixels;
		
Log.i("Metrics", widthMetrics + "  and    " + heightMetrics );

你可能感兴趣的:(DisplayMetrics用来获取屏幕的宽高)