Android:如何获取屏幕的宽高
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); DisplayMetrics dm = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(dm); pm_width = dm.widthPixels; pm_height = dm.heightPixels;
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); DisplayMetrics dm = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(dm); pm_width = dm.widthPixels; pm_height = dm.heightPixels;