How do I set the actionbar
mode at runtime to not-overlay or overlay with the content at runtime? I tried using getWindow().requestFeature(Window.FEATURE_ACTIONBAR_OVERLAY)
but it doesn't allow to set the mode after calling setContentView()
. This can be done, as I have seen it being done in the Youtube app.
Although not necessarily exactly what you're looking for, one decent workaround would be to create a spacer view at the top of the content that is the same height as the ActionBar (android:layout_height="?android:actionBarSize"). When you want overlay mode enabled, set the spacer's visibility to View.GONE, when you want it disabled, set it to View.VISIBLE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With