How to make AppBarLayout background transparent
<p>I'm trying to make a search fragment similar to the one in the Play Store:</p>

<p><a href="https://i.stack.imgur.com/AG5KD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AG5KD.png" alt="Google Play Store"></a></p>

<p>My <code>AppBarLayout</code> has a <code>CardView</code> in it, and the background is set to transparent:</p>

<pre><code>&lt;android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"&gt;

    &lt;android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
        app:elevation="0dp"&gt;

        &lt;!-- CardView --&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;

    &lt;android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;

        &lt;!-- Main content --&gt;

    &lt;/android.support.v4.widget.NestedScrollView&gt;
&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>But as you can see, there is a solid background behind the <code>CardView</code> so that the content behind it is hidden:</p>

<p><a href="https://i.stack.imgur.com/IfXVA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IfXVA.png" alt="Hidden content"></a></p>

<p>How can I make the <code>AppBarLayout</code>'s background transparent so that the content behind is visible?</p>