Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Toolbar transparent?

It is self Q&A post I have transparent ActionBar which overlays layout. After migration to the latest support library I have been forced to get rid off the ActionBar in favor of the Toolbar. The old ways to make it transparent and overlay that layout doesn't work anymore.

<style name="CustomActionBarTheme" parent="@android:style/Theme.AppCompat">     <item name="android:windowActionBarOverlay">true</item>     <item name="windowActionBarOverlay">true</item>     <item name="android:actionBarStyle">@style/TransparentActionBar</item> </style>  <style name="TransparentActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">     <item name="android:background">@android:color/transparent</item> </style> 
like image 558
Gleichmut Avatar asked Oct 22 '14 10:10

Gleichmut


People also ask

How do I make my taskbar 100% transparent?

Switch to the “Windows 10 Settings” tab using the header menu of the application. Make sure to enable the “Customize Taskbar” option, then choose “Transparent.” Adjust the “Taskbar Opacity” value until you're satisfied with the results. Click on the OK button to finalize your changes.


1 Answers

Create your toolbar.xml file with background of AppBarLayout is @null

<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout     android:id="@+id/general_appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:background="@null"     xmlns:android="http://schemas.android.com/apk/res/android">     <android.support.v7.widget.Toolbar         android:layout_width="match_parent"         android:layout_height="?attr/actionBarSize">         <TextView             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:gravity="center_horizontal"             android:text="Login"             android:textSize="20sp"/>     </android.support.v7.widget.Toolbar>  </android.support.design.widget.AppBarLayout> 

and here is result:

enter image description here

like image 132
Brian Vo Avatar answered Sep 21 '22 15:09

Brian Vo