Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 650
Hamza Asif Avatar asked Dec 22 '22 22:12

Hamza Asif


2 Answers

According to Google's Material Design specification, BottomNavigationView does not support more than 5 items. You can use another library for BottomNavigationView since you can't achieve this with Google's library.

Create a menu resource with up to 5 navigation targets (BottomNavigationView does not support more than 5 items).
https://material.io/develop/android/components/bottom-navigation-view/

Secondly, Having 5 or more items in BottomNavigation is a bad design in terms of User Experience. Even 4 is a stretch. If you need more than 5 items, BottomNavigation is not suitable for you.

like image 91
Zohaib Amir Avatar answered Dec 26 '22 00:12

Zohaib Amir


If you want that then u can take a Horizontal linear layout in that take the horizontal scroll and then take textview or button as much u like.

like image 37
Ayaan Avatar answered Dec 25 '22 22:12

Ayaan