当前位置: 代码迷 >> Android >> Android-获取荧屏尺寸
  详细解决方案

Android-获取荧屏尺寸

热度:74   发布时间:2016-05-01 14:34:22.0
Android-----获取屏幕尺寸

DisplayMetrics dm = new DisplayMetrics(); dm = cx.getApplicationContext().getResources().getDisplayMetrics(); int screenWidth = dm.widthPixels; int screenHeight = dm.heightPixels; 
?

?

?

   WindowManager windowManager = getWindowManager();Display display = windowManager.getDefaultDisplay();ANDROID_WIDTH = display.getWidth();ANDROID_HEIGHT = display.getHeight();
?
  相关解决方案