Questions tagged [navigationview]

Provides navigation drawer access. Part of Android's design support library.

Summary

Helps developers follow Android's material design standards by providing access to the navigation drawer.

Navigation View

The navigation drawer can be an important focal point for identity and navigation within your app and consistency in the design here can make a considerable difference in how easy your app is to navigate, particularly for first time users. NavigationView makes this easier by providing the framework you need for the navigation drawer as well as the ability to inflate your navigation items through a menu resource.

Reference

770 questions
184
votes
10 answers

NavigationView get/find header layout

In my NavigationView I have a header layout with id 'viewId' with active buttons. To setup those buttons, I do the following in activity's onPostCreate: final View panel = findViewById(R.id.viewId); panel.setOnClickListener(new…
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.…
89
votes
2 answers

NavigationView and custom Layout

I'm using the Designs Support Libraries NavigationView like this:
79
votes
9 answers

How to customize item background and item text color inside NavigationView?

I wanna achieve something like this shown in the Material Design Docs. colorControlHighlight is used for the Background on checked items. I need to customize: background unchecked text color checked text color unchecked
78
votes
14 answers

Custom back button for NavigationView's navigation bar in SwiftUI

I want to add a custom navigation button that will look somewhat like this: Now, I've written a custom BackButton view for this. When applying that view as leading navigation bar item, by doing: .navigationBarItems(leading: BackButton()) ...the…
LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
74
votes
15 answers

How to set custom typeface to items in NavigationView?

With the new NavigationView, we are able to set a drawer's items through a menu resource in XML. With that, we can set each item with something like
Júlio Zynger
  • 1,168
  • 1
  • 9
  • 12
68
votes
5 answers

NavigationView menu items with counter on the right

The new NavigationView in the new Design Support Library works really great. They use "menu-items" to display the options. But how can I display a counter to the right of the menu item? Like in this picture: Or like in the GMail app.
48
votes
5 answers

How to change the size of menu item icon in NavigationView?

I have the following menu item:
Chris Maverick
  • 928
  • 1
  • 8
  • 18
45
votes
5 answers

Is there a SwiftUI equivalent for viewWillDisappear(_:) or detect when a view is about to be removed?

In SwiftUI, I'm trying to find a way to detect that a view is about to be removed only when using the default navigationBackButton. Then perform some action. Using onDisappear(perform:) acts like viewDidDisappear(_:), and the action performs after…
FRIDDAY
  • 3,781
  • 1
  • 29
  • 43
44
votes
21 answers

SwiftUI NavigationLink Hide Arrow

Is there a way to hide the arrow to the right of the navigation link view that is automatically added? I want to show an image grid using NavigationView -> List -> HStack -> NavigationLink_1 - NavigationLink_2 The NavigationLinks have arrows and it…
blackops
  • 2,205
  • 2
  • 18
  • 22
44
votes
6 answers

How can I change separator color in NavigationView?

I'm trying to use NavigationView to implement NavigationDrawer. I have added the separator by setting group id in menu. However I can't see the separator. I guess it is because the separator color is same as the background. So I want to change the…
40
votes
2 answers

How to get dividers in NavigationView menu without titles?

I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all…
Jeff Lockhart
  • 5,379
  • 4
  • 36
  • 51
38
votes
6 answers

How to add custom views in the new NavigationView

I'm trying to add a switch as menuitem in NavigationView like this I used the the actionViewClass attribute but it only shows the title.
atabouraya
  • 3,233
  • 1
  • 26
  • 31
34
votes
12 answers

How to uncheck checked items in Navigation View?

I know it's possible to highlight a navigation view item by calling setCheckedItem() or return true value in onNavigationItemSelected to display the item as the selected item, but How can I uncheck the checked items of a navigation view?
Hafez Divandari
  • 8,381
  • 4
  • 46
  • 63
34
votes
3 answers

How to add an item to a menu group in NavigationView

In a word game for Android I currently have a hardcoded menu inflated from left_drawer_menu.xml and consisting of 3 groups (my turn, opponent turn and finally other stuff): mLeftDrawer = (NavigationView)…
Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
1
2 3
51 52