Navigation Drawer - Divider between sections like Gmail App

后端 未结 3 1279
轮回少年
轮回少年 2021-01-07 08:14

I am updating the Navigation Drawer in my app. I want to add section dividers as the Gmail App has. How do I add them? Just add them as views, which is a simple approach. Bu

3条回答
  •  轮回少年
    2021-01-07 09:16

    Use NavigationView inside DrawerLayout as its second child. Insert items in menu and apply menu attribute to NavigationView to display list items in Navigation Drawer. You can then give group id to menu items to be placed inside which will automatically creates a divider. For broader explanation, pls follow :

    How to create a simple divider in the new NavigationView?

提交回复
热议问题