首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在安卓系统中关闭StatusBar?

如何在安卓系统中关闭StatusBar?
EN

Stack Overflow用户
提问于 2016-06-08 01:29:40
回答 1查看 55关注 0票数 0

我已经编写了一个自定义的Action Bar。问题是,为了使用这个操作栏,我在清单中使用了我的自定义主题。我还想禁用StatusBar。我该怎么做?

代码语言:javascript
复制
<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.

-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->

<item name="colorPrimary">@color/red</item>
<item name="colorPrimaryDark">@color/red</item>
</style>

EN

回答 1

Stack Overflow用户

发布于 2016-06-08 01:40:03

首先,谷歌不鼓励这种行为,说:

您不应该在没有状态栏的情况下显示操作栏。

但是,如果您坚持这样做的话。试试下面这段代码:

代码语言:javascript
复制
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

摘自:https://developer.android.com/training/system-ui/status.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37685684

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档