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
0
votes
2 answers

How can I add top drawer and bottom navigation in android activity?

How to add top drawer and bottom tab navigation in whole application? I tried to combine 2 activity in android studio and its causing design issue. Its not working
0
votes
1 answer

Comparing a fragment in a FrameLayout to another fragment

I have an app with Bottom navigation which changes between three fragments. I added transition when I click the menu item and I would like to be able to customize them more so that when I go from the left item (navigation_sync) to the right…
0
votes
1 answer

Fragment crash while switching between them quickly inside BottomNavigation

I have my MainActivity inside which I have BottomNavigation which loads fragment with the following method private boolean loadFragment(Fragment fragment) { //switching fragment if (fragment != null) { …
yuj
  • 11
  • 4
0
votes
2 answers

How can I show bottomnavigationbar on every phone?

I am trying to implement bottomNavigationBar together with google Maps. But GoogleMaps takes all the space left and overrides the bottomNavigatonBar. If I define googleMaps height with "dp" or so it only works for one screensize. Is there any way to…
Tobias D
  • 87
  • 1
  • 2
  • 13
0
votes
1 answer

how i can change or add shape behind the icon with BottomNavigationViewEx in android studio

I use BottomNavigationViewEx , and i want to do something like this in my Bottom Navigation , I want to change or add shape behind the icon and change position of the center item only . I tried for position this function …
0
votes
1 answer

How i can hide BottomNavigationView when list view scroll

I have created an app with BottomNavigationView but I want when user scroll the list view then BottomNavigationView should hide. I tried a lot but I am not able to do that. Can anyone help me? Layout…
Aakash Jain
  • 87
  • 10
0
votes
1 answer

How to set BottomNavigationView letterSpacing?

In TextView, I can use android:letterSpacing="0.1" to set letter spacing But this is not work in BottomNavigationView I use this code to set font style of BottomNavigationView I guess I can also set letter spacing here, but I cannot find related…
CL So
  • 3,647
  • 10
  • 51
  • 95
0
votes
3 answers

Bottom Navigation Icons are Cropped Android

I'm assembling an app with a Botton navigation bar in Android with Android Studio. With two icons it looked fine, but when I added four, the icons look cropped. I can't find any other error like this. Any suggestions are welcomed. Cropped icons…
0
votes
1 answer

BottomNavigationView with drawermenu and fab

The designer at my company wants me to make something like this for a BottomNavigationBar: that is, a BottomNavigationView with a drawermenu on the left and an overlapping fab on the right. As far as I can tell, this is not covered in any of the…
0
votes
2 answers

Back button behaviour on activity to fragment in bottom navigation view

I have a bottomnavigationview containing 5 fragments,(Consider A(Home), B, C, D, E) If I go to fragment D and then an Activity (Which is inside fragment D or C or any of 5) and press back button of the device. It is directly going to Home…
0
votes
2 answers

Text view contents not appearing on the phone screen in android using Kotlin

I am unable to display the textviews and their contents on screen. The app does not crash but the debugger console displays this error. It shows that the causes are the following. Caused by: android.view.InflateException: Binary XML file line #11:…
0
votes
1 answer

How to dim system bars on one click on the activity and again show system bars on the second click on the screen?

Please Check the Images Image 1 Image 2 after one click I want to hide and show all system bars (status bar, Action Bar and Bottom Navigation Bar) in every clicks on the activity screen.
0
votes
1 answer

React native navigation example

I want to implement navigation betwen these screens; I want to have 5 screens; 1 is Login screen(first screen when user open app) 2 is Main screen with 2 bottom tabs in it...Each of these two tabs will have specific header. 3&4 is some other…
0
votes
1 answer

How to increase icon position if item is selected in BottomNavigationView

What I am trying to accomplish is basically having the icon move up a little bit when the icon is selected and move back down when another icon is selected in a BottomNavigationView. Almost like an animation indicating what fragment the user is on.…
Kristofer
  • 809
  • 9
  • 24
0
votes
2 answers

How to load multiple fragments in activity android

I have class BottomNaviationViewHelper which I use for Bottom Naviation View. And I need to load fragments in this activity. But when i run my app nothing happens. BottomNaviationViewHelper.class public void …
1 2 3
99
100