我有以下代码来隐藏状态栏,取自 http://developer.android.com/training/system-ui/status.html和 Hide status bar android
//hide statut bar
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();
}
我在 View.SYSTEM_UI_FLAG_FULLSCREEN
上遇到错误;
View 中似乎不再存在 SYSTEM_UI_FLAG_FULLSCREEN
。
如何解决?请谢谢你
最佳答案
它自 API16 起就存在。您必须针对 API16(或更高版本)构建您的应用
关于java - Android隐藏状态栏、兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21661095/