i trying make toolbar/actionbar transparent. can see transparent toolbar hides behind widget loaded fragment. widget carousel of images. when image flip, can see toolbar below it. app theme.
<style name="apptheme" parent="@style/theme.appcompat.light"> <item name="colorprimary">#19b333</item> <!-- actionbar theming --> <item name="android:actionbarstyle">@style/myactionbar</item> <!-- support library compatibility --> <item name="actionbarstyle">@style/myactionbar</item> </style>
this actionbar theme.
<style name="myactionbar" parent="themeoverlay.appcompat.light"> <item name="android:background">@color/color_primary</item> <item name="android:windowactionbaroverlay">true</item> <!-- support library compatibility --> <item name="background">@color/color_primary</item> <item name="windowactionbaroverlay">true</item> </style>
and toolbar:
<android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:minheight="?attr/actionbarsize"/>
this activity_drawer layout
<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawer_layout" tools:context=".activity.draweractivity"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" > <include layout="@layout/view_toolbar"/> <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> </relativelayout> <fragment android:name="com.example.fragment.sidebarfragment" android:id="@+id/sidebar" android:layout_width="@dimen/sidebar_width" android:layout_height="match_parent" android:layout_gravity="start" tools:layout="@layout/fragment_sidebar" /> </android.support.v4.widget.drawerlayout>
put toolbar after content container.
<relativelayout android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <include layout="@layout/view_toolbar"/> </relativelayout>