Questions tagged [navigation-drawer]

Navigation Drawer in a mobile application is the side panel which slides out from the edge of the screen and displays the navigation menu of the application. Use this tag for programming questions related to navigation drawers only. General UX questions and other opinion based questions related to navigation drawers are not on topic for Stack Overflow.

Navigation Drawer in Android

The navigation drawer is commonly used as a "slide-in" navigation menu in Android applications. It slides in from the edge of the screen and displays a list of the application's main navigation options.

The drawer slides on top of the content instead of the content sliding away. With this, one can access any top level content from anywhere in the app and allows you to create a flatter navigation structure. It also has an action bar at the top. Lower versions also support it through support library.

Documentation

  • Design docs can be found here.
  • Developer docs can be found here.
  • DrawerLayout API reference can be found here.

Related tags:

5793 questions
409
votes
5 answers

Navigation Drawer (Google+ vs. YouTube)

Does anyone know how to implement a sliding menu like some of the top apps of today? Other Stack Overflow questions haven't had any answers on how to do this, so I'm trying to gather as much info to help out others. All the applications I mention…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
403
votes
10 answers

How do I use DrawerLayout to display over the ActionBar/Toolbar and under the status bar?

I've seen in the new material design Side Nav spec that you can display the drawer over the action bar and behind the status bar. How can I implement this?
Chris Banes
  • 31,763
  • 16
  • 59
  • 50
244
votes
20 answers

Navigation drawer: How do I set the selected item at startup?

My code works perfectly: every time an item in Navigation Drawer is clicked the item is selected. Of course I want to start the app with a default fragment (home), but Navigation Drawer doesn't have the item selected. How can I select that item…
sineverba
  • 5,059
  • 7
  • 39
  • 84
212
votes
13 answers

Same Navigation Drawer in different Activities

I made a working navigation drawer like it's shown in the tutorial on the developer.android.com website. But now, I want to use one Navigation Drawer, i created in the NavigationDrawer.class for multiple Activities in my Application. My question is,…
MEX
  • 2,664
  • 5
  • 22
  • 28
177
votes
12 answers

Switching between Android Navigation Drawer image and Up caret when using fragments

When using the Navigation Drawer the Android devs are recommending that in the ActionBar "only those screens that are represented in the Navigation Drawer should actually have the Navigation Drawer image" and that "all other screens have the…
EvilAsh
  • 1,773
  • 2
  • 11
  • 5
164
votes
14 answers

How to create a simple divider in the new NavigationView?

Google introduced the NavigationView in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource. How can I create a simple divider line between two items? Grouping the items didn't work.…
108
votes
12 answers

Cannot catch toolbar home button click event

I've implemented the newest appcompat library and using the Toolbar as action bar. But the problem is I cannot catch the home button / hamburger icon click event. I've tried and looked everything but doesn't seem to find a similar problem. This is…
Dark Leonhart
  • 1,494
  • 2
  • 13
  • 21
102
votes
5 answers

How to add one section separator for Navigation Drawer in Android?

I have a navigation drawer like this image. I want to add a section separator (like the line separating Neptune). It seems simple but I can't find anything on the web that was useful for my case. Here is my MainActivity: public class MainActivity…
94
votes
13 answers

How to change color of hamburger icon in material design navigation drawer

I am following this example http://www.androidhive.info/2015/04/android-getting-started-with-material-design/ and in this example it is showing hamburger icon white,i want to customize it and make it black,but i am not able to find anything to how…
Aditya
  • 1,508
  • 1
  • 19
  • 37
93
votes
9 answers

How to set custom ActionBar color / style?

I am using Android Navigation bar in my project, I want to change the top color in action bar to something red, How can i do that? I have something like this, and i want something like this, how can i achieve that?
hemantsb
  • 2,049
  • 2
  • 20
  • 29
91
votes
9 answers

Navigation Drawer semi-transparent over status bar not working

I am working on Android project and I am implementing the Navigation Drawer. I am reading through the new Material Design Spec and the Material Design Checklist. The spec says that the slide out pane should float above everything else including the…
Boardy
  • 35,417
  • 104
  • 256
  • 447
90
votes
15 answers

How to set Navigation Drawer to be opened from right to left

First of all I know this question appeared here before but after trying a lot I still didn't succeed. I working on the example from Android Developers site. I'm trying to set the menu to be opened from right to left instead of how its implementing…
galvan
  • 7,400
  • 7
  • 38
  • 55
89
votes
7 answers

How to close navigation drawer when an item is pressed from it?

Ideally navigation drawer should get closed once some item has been pressed from it, but its not happening automatically. How to do it ? Thanks!
Vipul J
  • 6,641
  • 9
  • 46
  • 61
83
votes
7 answers

Flutter navigation drawer hamburger icon color change

Hamburger icon color of navigation drawer is not changing. Its black by default. I want to change the this icon color in flutter, I am stuck, help me to change this icon color. here is my code. class Test extends StatefulWidget…
Ammy Kang
  • 11,283
  • 21
  • 46
  • 68
82
votes
10 answers

Hide a Navigation Drawer Menu Item - Android

I have a navigation drawer. When an event is called, I want to hide one of my navigation menu item for user. How can I do that? protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
huzain07
  • 1,051
  • 2
  • 8
  • 17
1
2 3
99 100