Navigation Drawer without Actionbar

后端 未结 2 1199
遇见更好的自我
遇见更好的自我 2020-12-30 23:54

I searched many sites (stackoverflow as well) but couldn\'t understand how to implement the navigation drawer without the action bar. I know that this question has already b

相关标签:
2条回答
  • 2020-12-31 00:01

    Starting from the Sample Android NavigationDrawer app:

    1. Use the Activity theme: Theme.NoTitleBar
    2. Erase all the ActionBar references in the code
    3. Create a button and in the clickListener call:

      drawer.openDrawer(Gravity.LEFT);

    0 讨论(0)
  • 2020-12-31 00:14

    Just add your DrawerLayout like @mohan did, then if you have a button or something you tap on and want to open the drawer, just do like this :

    drawer.openDrawer(Gravity.LEFT);
    

    and to close :

    drawer.closeDrawer(Gravity.LEFT);
    
    0 讨论(0)
提交回复
热议问题