Make transparent ActionBar in Android


Step1: In value/style.xml:

<style name="AppTheme" parent="Theme.AppCompat.Light">
<style name="AppTheme.ActionBar.Transparent" parent="AppTheme">
    <item name="android:windowContentOverlay">@null</item>
    <item name="windowActionBarOverlay">true</item>
    <item name="colorPrimary">@android:color/transparent</item>

<style name="AppTheme.ActionBar" parent="AppTheme">
    <item name="windowActionBarOverlay">false</item>
    <item name="colorPrimary">@color/default_yellow</item>

Step2: in AndroidManifest.xml > placed in activity you want to make transparent ActionBar:



f you want to make sure there aren’t Views under your Action Bar, you can add a top margin to it in the XML.

    android:layout_paddingTop="?android:attr/actionBarSize" />


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s