I'd like to know if anyone knows how to make an activity with transparent action bar, like the one you have in the new Google Play Store when you go to an app's page.
I don't care about the scrolling and turning from transparent into solid color background, I just need the action bar transparent.
Thanks.
Transparent Actionbar
values/styles.xml:
values-v21/styles.xml:
use these themes in your AndroidManifest.xml to specify which activities will have a transparent or colored ActionBar
You just need to put
<item name="colorPrimary">@android:color/transparent</item>
and setwindowActionBarOverlay
to true on your app theme like this:Final result should look like this:
There is also way to do it pragmatically.
1) Set
AppBarLayout
elevation property to0dp
.2) Set
Toolbar
background color to transparent.Whole xml will look like below:
This above will result exception on Lollipop devices. colorPrimary must be opaque.
Stylish your actionbar using style:
And in your theme, just include: