![]() Here we add three items Home, Profile, Settings. Enter file name as nav_menu and select Resource Type as Menu. ![]() Then create a new menu resource file by following these steps. You can add images and text according to your requirement. I am just creating a blank layout for simplicity of this tutorial. In next step create a new layout resource file and name it nav_header. Here our main content is in LinearLayout which has toolbar and a textview to show current item selected. Keep your main content as the first child of this layout. We can also add header to this view.ĭrawerLayout: This layout act as a root layout. It is scrollable view that renders menu resource file and display it as list. ![]() NavigationView: NavigationView is an easy way to display a navigation menu from a menu resource. In this layout we have NavigationView and DrawerLayout, I will explain it one by one. Then go to your activity_main.xml file and add below code Lets start with adding dependencies, so go to your adle(app level) file and add design dependency. In this article we are going to learn how to make a navigation drawer or you can say side menu in android using kotlin language.Ĭreate a new project in android studio.
0 Comments
Leave a Reply. |