Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent Navigation Bar for Lollipop app?

What do I add to themes.xml to change the navigation bar to be more transparent? I can't find documentation for it anywhere. Thanks!

like image 639
sanic Avatar asked Nov 09 '14 02:11

sanic


People also ask

How do I make my navigation bar transparent?

Creating a transparent navbar is very easy - just don't add a color class . bg-* to the navbar. In this case, the Navbar will take the color of the parent's background color.

Can you hide the navigation bar?

Using the Show and hide button at the left side of the navigation bar, you can set the navigation bar to be hidden or pinned on the screen when you use apps or features. The navigation bar is pinned by default.

How do I change the navigation bar style in Android?

There are two ways to style the navigation bar depends on how you create it. One is using the XML style file if you create the navigation bar from XML. The other one is to change it using code.


2 Answers

In your theme add the following line:

<item name="android:windowTranslucentNavigation">true</item>

Romain Guy has published a nice sample app that uses this API. Maybe it will help. (You might need to refactor some code since the project was originally written using the Android L developer preview).

like image 66
Alex Lockwood Avatar answered Nov 08 '22 09:11

Alex Lockwood


Alex's answer is correct. You can use

<item name="android:windowTranslucentNavigation">true</item>

Another option is to use

<item name="android:windowBackground">@android:color/transparent</item>
like image 37
Alex K Avatar answered Nov 08 '22 10:11

Alex K