Android平板电脑导航栏将不会隐瞒 [英] Android tablet navigation bar won't hide

查看:109
本文介绍了Android平板电脑导航栏将不会隐瞒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图隐藏导航栏,用我在网上找到所描述的方法。

I'm trying to hide the navigation bar, using methods I've found described on the internet.

我有一个简单的布局,其中显示了一个web视图:

I have a simple layout which shows a WebView:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:id="@+id/layout" >

    <WebView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

</RelativeLayout>

这是我使用的应用程序启动时的code是:

The code that I'm using at app startup is:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    web.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

不过,这并不能掩盖导航栏。

But this doesn't hide the navigation bar.

我添加...

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

......我活动了。

... to my activity too.

我怎样才能做到这一点?

How can I achieve this?

推荐答案

您不能永久隐藏在平板电脑上的系统吧。

You cannot permanently hide the system bar on a tablet.

SYSTEM_UI_FLAG_HIDE_NAVIGATION 的在Android 4.1及更高版本将隐藏系统栏,但它会为用户做任何事情,一旦再次出现。

SYSTEM_UI_FLAG_HIDE_NAVIGATION on Android 4.1 and higher will hide the system bar, but it will reappear as soon as the user does anything.

这篇关于Android平板电脑导航栏将不会隐瞒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆