屏幕尺寸:
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
第一句子网 - 唯美句子、句子迷、好句子大全