Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 移除导航栏_Android_Android Layout_Navigationbar - Fatal编程技术网

Android 移除导航栏

Android 移除导航栏,android,android-layout,navigationbar,Android,Android Layout,Navigationbar,我面临着严重的问题 我正在为Android API 14开发一个应用程序(>=Android 4.0)。我在一些设备上测试了这个应用程序,效果很好,但是屏幕上有导航条的设备不起作用。 我看到了一些答案,但没有任何效果 以下是导航栏的图像: 我有两个问题: 1) 有没有办法永远隐藏导航栏?我正在开发一个游戏,所以我不想这个酒吧出现。哪一个是最好的解决方案?也许不想用导航栏隐藏和计算屏幕大小 2) 当我在图形布局中开发时,我试图隐藏添加主题的导航栏:Theme.Holo.NoActionBar.Fu

我面临着严重的问题

我正在为Android API 14开发一个应用程序(>=Android 4.0)。我在一些设备上测试了这个应用程序,效果很好,但是屏幕上有导航条的设备不起作用。 我看到了一些答案,但没有任何效果

以下是导航栏的图像:

我有两个问题:

1) 有没有办法永远隐藏导航栏?我正在开发一个游戏,所以我不想这个酒吧出现。哪一个是最好的解决方案?也许不想用导航栏隐藏和计算屏幕大小

2) 当我在图形布局中开发时,我试图隐藏添加主题的导航栏:Theme.Holo.NoActionBar.Fullscreen,但导航仍在那里,因此当我定位一些视图时,当我在设备中运行应用程序时,视图的位置不正确


谢谢

试试这个,在活动的onCreate中打电话

public void makeFullScreen() {
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    if(Build.VERSION.SDK_INT < 19) { //View.SYSTEM_UI_FLAG_IMMERSIVE is only on API 19+
        this.getWindow().getDecorView()
                .setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    } else {
        this.getWindow().getDecorView()
                .setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE);
    }
}
public void makeFullScreen(){
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_全屏,
WindowManager.LayoutParams.FLAG(全屏);
如果(Build.VERSION.SDK\u INT<19){//View.SYSTEM\u UI\u FLAG\u IMMERSIVE仅在API 19上+
this.getWindow().getDecorView()
.SetSystemMivibility(视图、系统、用户界面、标志、隐藏、导航);
}否则{
this.getWindow().getDecorView()
.SetSystemMibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE);
}
}