//获取屏幕长宽 WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); wm.getDefaultDisplay().getHeight(); wm.getDefaultDisplay().getWidth(); //获取status bar高度 View rootView = view.getRootView(); Rect r = new Rect(); rootView.getWindowVisibleDisplayFrame(r); return r.top; //设置全屏 //xml <style name="style_Fullscreen"> <item name="android:windowFullscreen">true</item> <item name="android:windowNoTitle">true</item> </style> //java code this.requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
?