BottomNavigationView - How to uncheck all MenuItems and keep Titles being displayed?

后端 未结 10 1344
面向向阳花
面向向阳花 2020-12-18 19:33

As I liked the design from BottomNavigationView I decided to implement a new Menu for my App with it, instead of just using simple buttons.

I took this

10条回答
  •  不思量自难忘°
    2020-12-18 20:10

    There is an exception in accepted answer which we set maximum item we cant implement that code.So I got a code that is more simple than accepted code and it's also working with maximum item.

    I referred from here Custom TextSize of BottomNavigationView support android

    In your dimen.xml you can put:

    10sp
    10sp
    

    Doing this you are overriding the default value of dimen that the internal classes of BottomNavigationView use. So be carreful.

    Set this code in your onCreate method where the bottom navigation view initialized

    mNavigationBottom.getMenu().setGroupCheckable(0, false, true);
    

    and Last set your bottom navigation bar like this :

     
    

    In this set your app:labelVisibilityMode to labeled

提交回复
热议问题