标签:android class c code java ext
android获取屏幕的高度和宽度用到WindowManager这个类,两种方法: |
1 、WindowManager wm = (WindowManager) getContext() .getSystemService(Context.WINDOW_SERVICE); int
width = wm.getDefaultDisplay().getWidth(); int
height = wm.getDefaultDisplay().getHeight(); 2 、WindowManager wm = this .getWindowManager(); int
width = wm.getDefaultDisplay().getWidth(); int
height = wm.getDefaultDisplay().getHeight(); |
android获得屏幕高度和宽度,布布扣,bubuko.com
标签:android class c code java ext
原文地址:http://www.cnblogs.com/caicaixu/p/3737376.html