Search code examples
androidkotliniconsmenuitembottomnavigationview

How to remove/hide place for icon of menu item android


I am newer in android I am using bottomNavigationView, and in menu i don't need to use icons, because of this, an empty space appeared. I've tried decrease height of menu and of bottomNavigationView but nothing is helped. It is my BottomNavigationView

Menu

Result

Any links, comments, explanations will hepl me


Solution

  • I found decision

    added in my build.gradle

    implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
    implementation "com.android.support:design:28.0.0"
    

    Changed BottomNavigationView to BottomNavigationViewEx

    and in my Fragment

    val bottomNavigationView = requireView().findViewById<BottomNavigationViewEx>(R.id.bottom_navigation_view_ex)
    bottomNavigationView.setIconVisibility(false)