DrawerLayout is not visible if I use constraintLayout as root layout it still opens and closes, but it's not visible. It works if I make drawerLayout as root or another layout like RelativeLayout or LinearLayout. Any idea why that is happening?
This doesn't work
<ConstraintLayout>
<DrawerLayout>
These works
<DrawerLayout>
<ConstraintLayout>
<LinearLayout>
<DrawerLayout>
<RelativeLayout>
<DrawerLayout>
DrawerLayout
acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from one or both vertical edges of the window.
That's why you can't make it as child to other ViewGroups
.
Check reference here