How do I make DrawerLayout to display below the Toolbar?

前端 未结 7 1102
耶瑟儿~
耶瑟儿~ 2020-11-27 15:01

How to make the drawer layout be below the actionbar/toolbar? I\'m using v7:21 app compat library with the new ToolBar view.

Examples that I see looks like



        
7条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 15:57

    I have found a simpler solution: Set the DrawerLayout and NavigationView attribute:

    android:fitsSystemWindows="false"
    

    and then give marginTop to navigation view as

    "?actionBarSize"
    

    maybe your statusbar background will become transparent in that case in styles.xml add

    @color/colorPrimaryDark
    

    attribute to get back the normal color or any other color you want...

提交回复
热议问题