如何禁用所有的物理按键$平板设备页上$ psent [英] How to disable all the physical buttons present on a tablet device

查看:262
本文介绍了如何禁用所有的物理按键$平板设备页上$ psent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
    android:id="@+id/menu_settings"
    android:orderInCategory="100"
    android:showAsAction="never"
    android:title="@string/menu_settings"
    android:visible="false"/>


</menu>

我已经试过这样做,但只有设置按钮变得不可见。我想我的禁用选项卡上的所有按钮present。

I have tried doing this, But only the setting button gets invisible. I want to disable all the buttons present on my tab.

我甚至试图做的部份。

protected void onCreate(Bundle savedInstanceState) {

 getActionBar().setDisplayHomeAsUpEnabled(false);
   }

但没有得到任何结果。

But no results obtained.

推荐答案

隐藏元素动作条

如果您希望禁用上行按钮,你应该这样:

If you want to disable the Up-Button you should to this:

getActionBar().setHomeButtonEnabled(false);

如果您不希望 OptionsMenu 不是删除 onCreateOptionsMenu 方法。

If you don't want a OptionsMenu than delete your onCreateOptionsMenu Method.

更新2013 11月22日:

隐藏系统导航:

    View rootView = getWindow().getDecorView().getRootView();
    rootView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_HIDE_NAVIGATION );

不过,请仔细阅读该标志的API:

But please read the API of this FLAG:

http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_HIDE_NAVIGATION

这篇关于如何禁用所有的物理按键$平板设备页上$ psent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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