webview应用程序上的半透明状态栏

时间:2014-06-14 17:43:10

标签: android webview

问候家伙,我是一名初学Android开发者,我的问题是......

是否可以在加载我的网站的webview应用程序上制作半透明状态栏。

我一直在玩styles.xml,但是我一直无法达到我想要的结果,我根本就没有状态栏/导航栏,但是不能让它们变成translusent比如在pushbullet应用程序或谷歌体验启动器上。

我正在使用kitkat sdk和最新版本的android studio。

1 个答案:

答案 0 :(得分:0)

您可以通过设置适当的主题项来完成。

仅适用于Android 3.0及更高版本

<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>

适用于Android 2.1及更高版本(使用AppCompat库)

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

        <!-- Support library compatibility -->
        <item name="windowActionBarOverlay">true</item>
    </style>
</resources>

取自Google Training documentation的例子。

相关问题