屏幕尺寸:
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
intscreenWidth = wm.getDefaultDisplay().getWidth();
intscreenHeight = wm.getDefaultDisplay().getHeight();
状态栏尺寸:
Rectframe=newRect();
getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
intstatusBarHeight=frame.top;
标题栏尺寸:
intcontentTop=getWindow().findViewById(Window.ID_ANDROID_CONTENT).getTop();
//statusBarHeight是上面所求的状态栏的高度
inttitleBarHeight=contentTop-statusBarHeight
1500字范文,内容丰富有趣,写作好帮手!