Android,沉浸式

 
 
private ActionBar mSupportActionBar;
/*
* 隐藏状态栏,隐藏通知栏,
* */
if (Build.VERSION.SDK_INT>=21) {//判断系统是否大于等于5.0系统

    mDecorView = getWindow().getDecorView();
    int option = View.SYSTEM_UI_FLAG_FULLSCREEN;
       /*
       *
       * */
           // | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    mDecorView.setSystemUiVisibility(option);
    /*
    * 设置通知栏为透明状态
    * */
   // getWindow().setStatusBarColor(Color.TRANSPARENT);
}
mSupportActionBar = getSupportActionBar();
mSupportActionBar.hide();

猜你喜欢

转载自blog.csdn.net/CC96864/article/details/80336955