How to disable BottomNavigationView shift mode?

后端 未结 21 2240
Happy的楠姐
Happy的楠姐 2020-11-22 15:55

BottomNavigationView doesn\'t show menu\'s title that are inactive.

How to show titles of all menu elements in bottomNavigationBar? The problem is that in my case s

21条回答
  •  自闭症患者
    2020-11-22 16:40

    As others have pointed out, since support library 28.0.0-alpha1 it is possible:

    
    

    or you can set it programatically.

    Note: if you are upgrading from an older version of support library, do not forget to raise compile SDK version. Check versions of support libraray here: Support Library versions

    However, you may still get labelVisibilityMode not found message when compile, if your app depends on older versions of the design support library. If this is the case, try to upgrade to a version of the given dependency, that depends on at least the version of 28.0.0-alpha1 of design support library. If that's not possible, define the dependency explicitly.

    If you use Gradle

    1. You can check your depdendecies by running dependencies task and search for the version number of com.android.support:design.
    2. To add design support dependency explicitly in your build.gradle:

      implementation 'com.android.support:design:28.0.0'

提交回复
热议问题