I created a ToolBar
which I set as my ActionBar
and I have it transparent, my question is I want it to overlay the rest of the content, right now i
in styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
...
</style>
<style name="ActionBar.SemiTransp" parent="Base.Widget.AppCompat.ActionBar">
<item name="displayOptions">showHome|showTitle</item>
<item name="background">@drawable/gray_to_transp</item>
</style>
<style name="AppTheme.SemiTranspActionBar" parent="@style/AppTheme">
<item name="actionBarStyle">@style/ActionBar.SemiTransp</item>
<item name="windowActionBarOverlay">true</item>
</style>
and in the manifest:
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.SemiTranspActionBar">
You can use CoordinatorLayout as below
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout"
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:fitsSystemWindows="true"
tools:context="com.epbit.itattooz.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?android:attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:titleTextAppearance="@style/ToolbarTitle"/>
<FrameLayout
android:id="@+id/containerView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Where frameLayout is for used fragments.