如何隐藏状态栏安卓4.1.2? 我想解决办法隐藏在4.1.2版本的状态栏
How to hide status bar android 4.1.2 ? i want solution to hide the status bar on version 4.1.2
我要隐藏状态栏在我的应用程序
i want to hide status bar on my application
LinearLayout layout = (LinearLayout)findViewById(R.id.layout);
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
这code不能在4.1.2版本下工作
this code not work on version 4.1.2
由于杰利贝恩(4.1)有一个不依赖于窗口管理新方法。而是使用setSystemUiVisibility关窗的,这给你更精确地控制系统的酒吧比使用窗口管理标志。下面是一个完整的例子:
Since Jellybean (4.1) there is a new method that doesn't rely on the WindowManager. Instead use setSystemUiVisibility off of the Window, this gives you more granular control over the system bars than using WindowManager flags. Here is a full example:
if (Build.VERSION.SDK_INT < 16) { //ye olde method
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else { // Jellybean and up, new hotness
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();
}
上一篇:如何创建机器人工作室自定义字体自定义、机器人、字体、工作室
下一篇:Android的onKeyLong preSS时的WebView存在存在、onKeyLong、Android、WebView