transparent status-bar / system-ui on 4.4 Kit Kat

ligi picture ligi · Nov 23, 2013 · Viewed 80.8k times · Source

This must be possible with 4.4, but I found no documentation on this yet - anyone knows how to make the status-bar / system-ui transparent/translucent ?

Answer

NPike picture NPike · Dec 13, 2013

Using one of the built-in themes precludes you from having an ActionBar.

Translucent system bars

You can now make the system bars partially translucent with new themes, Theme.Holo.NoActionBar.TranslucentDecor and Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable fitsSystemWindows for the portion of your layout that should not be covered by the system bars.

If you're creating a custom theme, set one of these themes as the parent theme or include the windowTranslucentNavigation and windowTranslucentStatus style properties in your theme.

If you wish to have transparent status bar, and transparent navigation with the use of an Action Bar - then simply add the following to your custom theme (in values-v19/styles.xml)

<style name="Theme.MyTheme" parent="Theme.MyTheme.Base">
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
</style>