Unable to get AppCompat ActionBar/Toolbar to become an overlay
android, android-appcompat
Solution
So, it turns out the issue was simultaneously totally simple, and yet not obvious (to me, at least). Basically the issue is that although the Toolbar is being set as the Actionbar, it is still at the end of the day a layout element declared in XML. So, the trick is of course to make sure it overlaps in the XML. Here's a sample from my layout, now:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/actionbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
All works as expected now. Hope this can help someone else if they have the same issue!
Problem
So, I have a Toolbar which I'm setting as my supportActionBar, which I want to be in overlay mode. At this point I feel like I've tried everything, but nothing seems to work. Here's the styles I currently have: ``` <style name="Theme.ArgleBargle" parent="@style/Theme.AppCompat.Light"> <item name="colorPrimary">@color/primary</item> <item name="colorAccent">@color/accent</item> <item name="vpiIconPageIndicatorStyle">@style/Widget.IconPageIndicator</item> <item name="vpiTabPageIndicatorStyle">@style/Widget.TabPageIndicator</item> <item name="windowActionBar">false</item> <item name="windowActionBarOverlay">true</item> <item name="android:windowActionBarOverlay">true</item> <item name="android:windowBackground">@color/background</item> </style> <style name="CustomActionBar" parent="@style/ThemeOverlay.AppCompat.Light"> <item name="android:windowActionBarOverlay">true</item> <!-- Support library compatibility --> <item name="windowActionBarOverlay">true</item> </style> ``` And here's the code for my Toolbar: ``` <android.support.v7.widget.Toolbar android:id="@+id/actionbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:minHeight="?attr/actionBarSize" android:background="?attr/colorPrimary" app:theme="@style/CustomActionBar"/> ``` And finally, here's where I'm setting it in the Activity: ``` actionbar = (Toolbar) findViewById(R.id.actionbar);; setSupportActionBar(actionbar); ``` I've also tried calling `getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY)` with no luck.