如何隐藏状态栏但不隐藏ActionBar?

时间:2014-07-09 18:31:50

标签: android

我想显示操作栏但隐藏状态栏,除非用户在我的Android应用中向下滑动。我该怎么做呢?

setSystemUIVisibility调用已经为我隐藏了一切。

1 个答案:

答案 0 :(得分:0)

试试这个:version 4.1及更高版本

View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

overlay操作栏

<resources>
    <!-- the theme applied to the application or activity -->
    <style name="CustomActionBarTheme"
           parent="@android:style/Theme.Holo">
        <item name="android:windowActionBarOverlay">true</item>
    </style>
</resources>
相关问题