当前位置:   article > 正文

安卓Activity全屏代码

全屏代码

我目前实现在Activity中重写 public Window getWindow()在里边写
/全屏显示/
View decorView = super.getWindow().getDecorView();
decorView.setSystemUiVisibility(0);
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

@Override
	public Window getWindow()
	{
		
		/*全屏显示*/
		View decorView = super.getWindow().getDecorView();
		decorView.setSystemUiVisibility(0);
		int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
			| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN |
			View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
		decorView.setSystemUiVisibility(uiOptions);
		
		
		//app_Window appwindowzz= new app_Window(this,super.getWindow());
		//WindowManager wmra=(WindowManager)getSystemService(android.content.Context.WINDOW_SERVICE);
		Window windowat= super.getWindow() ;
		//windowat.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//全屏
		windowat.getDecorView().setBackgroundColor(Color.parseColor("#D61509"));
		
		
		//Toast.makeText(this,"  获取Window ",Toast.LENGTH_SHORT).show();
		return windowat;
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/283486
推荐阅读
  

闽ICP备14008679号