0

我正在使用 Android 4.1,应用程序必须在 Piranha Ultra III Tab 10.1 上运行。

我将使用http://developer.android.com/design/get-started/ui-overview.html作为我的问题的命名参考;状态栏和导航栏...

我尝试了太多东西

主要建立在 Google 和 Stackoverflow 上;

1)

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

此代码只是禁用了状态栏,但没有禁用导航栏。

2)

我尝试了谷歌的全屏示例。该项目隐藏了导航栏和状态栏,但每次我点击或任何手势移动时,都会显示导航栏。我为手势和每个手势动作编写事件,我试图再次隐藏但也没有工作..

3)

http://developer.android.com/reference/android/view/View.html#setSystemUiVisibility%28int%29

我也试过这个,但与谷歌的全屏示例相同......

int newVis = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;

newVis |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;

newVis |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;

newVis |= View.SYSTEM_UI_FLAG_LOW_PROFILE;

newVis |= View.SYSTEM_UI_FLAG_FULLSCREEN;

newVis |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

// newVis |= View.SYSTEM_UI_FLAG_IMMERSIVE;

v.setSystemUiVisibility(newVis);

我还尝试了带有 XML 的示例(样式/布局/清单),但没有结果...

有没有其他方法可以做到这一点?

4

2 回答 2

1

If you hide the navigation buttons, Android force them to reappear on every interaction, because you don't want your users to be locked out in your app.

See this.

As far as I know, Android doesn't allow you to hide "permanently" (with or without gestures to pop it up again, except for Immersive Mode) the navigation bar, or maybe with root...

于 2014-01-22T09:31:12.980 回答
0

在您想要的活动下的清单中尝试此操作

<activity
    android:name="your activity"
    android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
</activity>
于 2014-01-22T09:34:40.220 回答