android - 为 Android > 4.1 隐藏 ActionBar

标签 android android-actionbar

我正在尝试显示在谷歌开发者页面中的这段代码,但没有成功。

 View decorView = getWindow().getDecorView();
 // Hide the status bar.
 int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
 decorView.setSystemUiVisibility(uiOptions);
 // Remember that you should never show the action bar if the
 // status bar is hidden, so hide that too if necessary.
 ActionBar actionBar = getActionBar();
 actionBar.hide();

我是否也应该在 list 文件中添加一些内容?

谢谢。

最佳答案

你可以用这样的代码隐藏你的操作栏。

ActionBar actionbar = getActionBar();
actionbar.hide();

或者如 M D 所述,您可以使用 NO Action Bar Theme 隐藏您的操作栏。

关于android - 为 Android > 4.1 隐藏 ActionBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27246624/

相关文章:

android - 为什么每当触摸Android中的任何通知时,通知总是显示最后一个通知

android - 主从流 Android 动画 API

java - 为什么我的操作栏没有显示以及如何修复它?

android - 中心操作栏标题

android - 将 android 谷歌地图置于标记组中心?

安卓工作室错误 :An existing connection was forcibly closed by the remote host

Android 应用程序与 Arduino 串行通信不同步

java - 无法为 Android 中的 java 方法创建 return 语句

android - 使用 ActionbarSherlock 和 jeremyfeinstein 滑动菜单自定义 ActionBar

android - 使用 AppCompat 的 ActionBar 下方的不确定水平 ProgressBar?