gpt4 book ai didi

Android 4.0.3 隐藏通知栏和标题栏

转载 作者:搜寻专家 更新时间:2023-11-01 08:09:46 25 4
gpt4 key购买 nike

我想让我的应用程序在任何 Android 设备上全屏显示。隐藏标题栏和通知栏。该应用程序应该在 Android 4.0.3 的 10 英寸平板电脑上运行。我正在使用以下代码,但只有标题栏消失了。我也想隐藏通知栏。谁能告诉我我的代码做错了什么?

getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

最佳答案

试试这个

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

希望对您有所帮助。

编辑:

The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). The navigation bar returns to view as soon as the system receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required

.

关于Android 4.0.3 隐藏通知栏和标题栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10961178/

25 4 0