6

我是android编程的新手!我想要一个像 Hill Climb Racing 这样的全屏图像(如下所示)

登山比赛

我尝试使用

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

但它只是消失了动作栏,我想同时消失动作栏和android默认键栏(主页按钮,返回和另一个)

4

2 回答 2

9

如果您的目标是 android 4.0 及更高版本

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

查看此开发者网站以获取更多详细信息

于 2014-03-25T17:41:10.520 回答
3

在清单上的活动中尝试此操作

 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
于 2014-03-25T17:36:40.497 回答