SlidingMenu
SlidingMenu copied to clipboard
android:windowTranslucentStatus is not working with the Slidingmenu
I have added the following lines in styles.xml
But the toolbar in the layout is still staying below the status bar and the color of the status bar seen gray. I want to show my layout and the sliding menu full screened including the status bar with a transparent color. What change should i make to enable this feature.
+1. You might try to change the sdk target to v22. and make -v19 v-21 for the old style settings since they dont support android:windowTranslucentStatus only for v21.
<!--v22-->
<style name="MaterialNavigationDrawerTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="belowToolbar">false</item>
<item name="drawerActionBarStyle">@null</item>
</style>
<!--v21 -->
<dimen name="statusMargin">24dp</dimen>
<dimen name="userSpace">188dp</dimen>
<dimen name="photoMarginTop">40dp</dimen>
<style name="MaterialNavigationDrawerTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="belowToolbar">false</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/transparent</item>
<item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="popupTheme">@style/Base.V21.Theme.AppCompat.Light.Dialog</item>
<item name="actionBarOverlay">false</item>
<item name="actionBarOverlayAlpha">1.0</item>
<item name="drawerActionBarStyle">@null</item>
</style>
<!--v19 -->
<dimen name="statusMargin">0dp</dimen>
<dimen name="userSpace">189dp</dimen>
<dimen name="photoMarginTop">16dp</dimen>
<dimen name="traslucentStatusMargin">25dp</dimen>
<dimen name="traslucentPhotoMarginTop">41dp</dimen>
<style name="MaterialNavigationDrawerTheme" parent="Theme.AppCompat.Light.NoActionBar" >
<item name="belowToolbar">false</item>
<item name="actionBarOverlay">false</item>
<item name="actionBarOverlayAlpha">1.0</item>
<item name="drawerActionBarStyle">@null</item>
</style>
mSlidingMenu.attachToActivity(activity, SlidingMenu.SLIDING_CONTENT, true);
Set slideStyle to SlidingMenu.SLIDING_CONTENT
and pass true
as third parameter (boolean actionbarOverlay) works for me.
I confirm that @chih-hao-li hack do the work. (But this is not a solution. The code need to be fixed)
@pguilbot how to fix ?
@NoahZu I don't know if a fix exist. The only solution to get a full height sliding menu (with a transparent status bar) was to used this method :
mSlidingMenu.attachToActivity(activity, SlidingMenu.SLIDING_CONTENT, true);
Changing the styles.xml file was not working (Api 15 and up)
thanks, I have salved it. This is a solution https://github.com/dalong982242260/FangTantan