gpt4 book ai didi

java - android全屏 Activity 并隐藏键栏

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:34:47 25 4
gpt4 key购买 nike

我是安卓编程的新手!我想要像 Hill Climb Racing 这样的全屏图像(如下所示)

Hill Climb Racing

我尝试使用

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

但它只是消失了操作栏,我想同时消失操作栏和 android 默认键栏(主页按钮、后退按钮和另一个按钮)

最佳答案

如果您的目标是 android 4.0 及更高版本

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

检查这个developer site获取更多详细信息

关于java - android全屏 Activity 并隐藏键栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22642026/

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