Questions tagged [bottomnavigationview]

Questions related to bottom navigation bar. Bottom Navigation Bar menu item title,icon,populating content and and enabled states related issues. Bottom navigation bar item click listener, item background resource,item text color, inflate menu,max item count. Bottom Navigation Bar is an implementation of material design bottom navigation.

BottomNavigationView

BottomNavigationView Represents a standard bottom navigation bar for application. It is an implementation of material design bottom navigation.

Bottom navigation bars make it easy for users to explore and switch between top-level views in a single tap. It should be used when application has three to five top-level destinations.

The bar contents can be populated by specifying a menu resource file. Each menu item title, icon and enabled state will be used for displaying bottom navigation bar items. Menu items can also be used for programmatically selecting which destination is currently active.


                                         BottomNavigationView

This widget has a couple of attributes set on it. We can use these to set menu items we wish to display and the colours to be used throughout the Bottom Navigation View:

  • app:itemBackground — The background color to be used for the bottom navigation menu
  • app:itemIconTint — The tint to be used for the icons in the bottom navigation menu
  • app:itemTextColor — The color to be used for the text in the bottom navigation menu
  • app:menu — The menu resource to be used to display items in the bottom navigation menu

We can also set these values programmatically by using the following methods on our BottomNavigationView instance:

  • inflateMenu(int menuResource) — Inflate a menu for the bottom navigation view using a menu resource identifier.
  • setItemBackgroundResource(int backgroundResource) — The background to be used for the menu items.
  • setItemTextColor(ColorStateList colorStateList) — A ColorStateList used to color the text used for the menu items
  • setItemIconTintList(ColorStateList colorStateList) — A ColorStateList used to tint the icons used for the menu items

Useful Links:

1718 questions
8
votes
5 answers

Android BottomNavigationView One tab with different unselected/selected colors

I am attempting to match a design like this.. Notice that the "selected tab color tint" is a blue, but the center tab's icon should always be the green circle with the white clock in the middle. I've tried a number of things. First trying to do it…
8
votes
2 answers

Flutter: How to add a column widget inside a bottom navigation bar

I've tried the following and got the out, but the body went blank. Is there any way to add a coloumn or a listview inside a bottom navigation bar Column( mainAxisAlignment:MainAxisAlignment.end, children: [ Row( …
Sunil sam
  • 81
  • 1
  • 3
8
votes
2 answers

How to change a specific icon image from Bottom Navigation View

I need to implement a Bottom Navigation View in my android app. The middle icon needs to be an image, the company logo. But when I run the app it appears only a grey filled rounded icon. The images above show what I want and what I'm getting. What I…
8
votes
3 answers

Can i add more than 5 menu items in bottom navigation view?

I am trying to add more then 5 items in bottom navigation view but its causing inflate error.
Hamza Asif
  • 101
  • 1
  • 1
  • 5
8
votes
3 answers

Add a top bar to a bottom navigation view item

I want to put a bar in the top of each Bottom Navigation View Item's items when it is selected. As the image below, but i don't find the way to do it. I dont have any idea how to do it
8
votes
1 answer

How to remove all animation of BottomNavigationView without Helper?

How to remove all animation of BottomNavigationView without any Helper or proGuard and in easy way with google material dependency com.google.android.material:material:1.0.0?
j.elmer
  • 1,441
  • 2
  • 17
  • 36
8
votes
6 answers

More than one file was found with OS independent path 'META-INF/androidx.legacy_legacy-support-core-utils.version'

I added BottomNavigationView and then things started to complicate. I don't know what's causing this error, when I build project it's okay but then when I want to play app in emulator - this error pops up. Here is my build.gradle: apply plugin:…
8
votes
1 answer

Add margins to navigation item in BottomNavigationView

I have a BottomNavigationView which I instantiate like this: BottomNavigationView navigationView = findViewById(R.id.bottom_navigation); navigationView.setOnNavigationItemSelectedListener(this); /menu/menu.xml looks like this:
kalabalik
  • 3,792
  • 2
  • 21
  • 50
8
votes
3 answers

More than 3 items in bottom navigation bar android

I am new to android and I am trying to make an app with more than 3 elements in the bottom navigation bar. I am able to display them but they are getting clustered at the end and only three are visible properly. Here is my…
DonJon
  • 95
  • 1
  • 1
  • 5
8
votes
3 answers

BottomNavigationView getmaxitemcount

Hello member stackoverflow porblem with bottomnavihationview in my app I used BottomNavigationView with 4 item . it make my app easy and beauty BottomNavigationView bottomNavigationView = (BottomNavigationView)…
Ayham Showa
  • 135
  • 1
  • 2
  • 10
8
votes
3 answers

Android BottomNavigationView evenly spaced icons

I have a BottomNavigationView with five items. The default behavior is to only show the label of the selected item and the spacing between all five items differs depending on what item is selected. I would like a bottom bar more simular to a…
Johan Nordberg
  • 3,621
  • 4
  • 33
  • 58
7
votes
2 answers

Show Bottom Modal Sheet above the Bottom Navigation Bar

Here in the below image I have added showModalBottomSheet on clicking on the item of "Bottom Navigation Bar", but the BottomNavigationBar is hidden by the modal sheet, So I want to make it visible even the bottom sheet is present. Can anyone please…
7
votes
2 answers

Android Bottom Navigation: space between icon and text

How to change the vertical space between icon and text in BottomNavigation programmatically? The only way I found is to modify dimens.xml: 60dp But it's not possible to…
7
votes
3 answers

Flutter - Disable Bottom Navigation Bar Animation (growing text)

I want to disable the Bottom Navigation Bar animation for selected item to get the same text/icon size of unselected items. That's my code: class BottomNavigationBarHome extends StatelessWidget { @override Widget build(BuildContext context) { …
Arfmann
  • 684
  • 9
  • 30
7
votes
6 answers

Bottom of NavHostFragment hidden behind BottomNavigationView

I have layout with a nav bar at the bottom and the main content inside a NavHostFragment. Now the bottom of the NavHostFragment is hidden behind the nav bar. How can I fix this? This is the main layout of the activity:
Holger
  • 475
  • 6
  • 14