无法删除导航栏 - Android平板电脑:4.2.2 [英] Unable to remove Navigation Bar - Android Tablet: 4.2.2

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

问题描述

我试图删除编程方式使用互联网上最常见的方法导航栏 - 但是导航栏中仍然出现。

我已经调试方法,它不抛出一个异常 - 所以我真的不知道为什么,我们似乎无法使用以下code隐藏的导航栏:

(任何建议是极大的AP preciated)

来源:

 尝试
{
流程PROC =调用Runtime.getRuntime()的exec(新的String [] {苏, - C,服务呼叫活动42 S16 com.android.systemui});
proc.waitFor();
}
赶上(异常前)
{
//Toast.makeText(getApplicationContext


解决方案

尝试这样做,你已经设置你的内容的看法某处后

要隐藏你的导航栏

 查看decorView = getWindow()getDecorView()。
INT uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

要隐藏键盘

  InputMethodManager IMM =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(),0);

有关更多的导航栏上,因为这是你的问题,明确要求,到这里看看:的隐藏导航栏

I'm attempting to remove the navigation bar programatically using the most commonly found method on the internet - however the navigation bar continues to appear.

I've debugged the method and it is not throwing an exception - so I'm really not sure why we can't seem to hide the Navigation Bar using the following code:

(any suggestions are greatly appreciated)

Source:

try
{
Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"}); 
proc.waitFor();
}
catch(Exception ex)
{
//Toast.makeText(getApplicationContext

解决方案

Try doing this, somewhere after you have set your content's view

To hide your navigation bar

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

To hide your keyboard

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

For more on the navigation bar, since it is what your question explicitly asks for, take a look here: Hiding the Navigation Bar

这篇关于无法删除导航栏 - Android平板电脑:4.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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