Closed woleigeququ closed 5 years ago
That's because you are using a dependency that is not MaterialDrawer. To make the notification bar transparent when you open the menu you have to put this line of code in your MaterialDrawer constructor:
mMainMenu = new DrawerBuilder()
.....
.withToolbar(toolbar)
.withTranslucentStatusBar(true)
.withTranslucentNavigationBar(true)
I hope it works for you. :)
i did that , but the problem still. then i set the backgound color of mainactivity to yellow.. it looks normal.. I used to think it would automatically turn yellow , just like other activity , i don't know much about it . (ㄒoㄒ)
Try adding
android:fitsSystemWindows="true"
In the main layout of the activity.
i set it in baseactivity after setContentView public static void setRootViewFitsSystemWindows(Activity activity, boolean fitSystemWindows) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { ... rootView.setFitsSystemWindows(fitSystemWindows); }} i tried to set it in xml, they have the same effect
@woleigeququ you use the proper theme?
it's my setting of theme : android:theme="@style/AppNoTitleTheme"
is that correct ? and .. i didn't use toolbar , so i didn't set "withToolbar(toolbar)" , does it affect the display?
You might also want to see comments here: https://github.com/mikepenz/MaterialDrawer/issues/2473
i want to : public abstract class BaseActivity extends AppCompatActivity { ... setContentView(initView());
...
then other activities can display normally , but the MainActivity which create drawer is like this :
the top of drawer is normal but main page isn't so could anyone help me ? thanks a lot .