gpt4 book ai didi

java - Android隐藏状态栏、兼容性

转载 作者:行者123 更新时间:2023-12-01 13:29:10 26 4
gpt4 key购买 nike

我有以下代码来隐藏状态栏,取自 http://developer.android.com/training/system-ui/status.htmlHide 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com