Remove bottom navigation view text in android

后端 未结 4 1456
情话喂你
情话喂你 2021-01-17 18:27

I use bottom navigation view for my app and want to remove the text under the icon. I looked for it on the internet but still can\'t find the solution. Did anyone use to dea

相关标签:
4条回答
  • 2021-01-17 18:53

    I find the solutions please check the below small changes.

    First of all change in bottomnavigation menu xml:

    Updated xml:

     <menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_favorites"
        android:enabled="true"
        android:icon="@drawable/ic_search"
        android:title=""
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/action_schedules"
        android:enabled="true"
        android:icon="@drawable/ic_search"
        android:title=""
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/action_music"
        android:enabled="true"
        android:icon="@drawable/ic_search"
        android:title=""
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/action_me"
        android:enabled="true"
        android:icon="@drawable/ic_search"
        android:title=""
        app:showAsAction="ifRoom" />
    </menu>
    
    0 讨论(0)
  • 2021-01-17 19:04

    set "app:labelVisibilityMode" with "unlabeled"

        <android.support.design.widget.BottomNavigationView
            android:id="@+id/navigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:labelVisibilityMode="unlabeled"/>
    
    0 讨论(0)
  • All you need to do is add this in your BottomNavigationView and the title and annoying animation is gone app:labelVisibilityMode="unlabeled"

    0 讨论(0)
  • 2021-01-17 19:07

    Remove titles in menu items.Then apply padding top to bottomnavigationview like below

    <menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
    android:id="@+id/action_favorites"
    android:tittle=""
    android:enabled="true"
    android:icon="@drawable/ic_search"
    app:showAsAction="ifRoom" />
    <item
    android:id="@+id/action_schedules"
    android:tittle=""
    android:enabled="true"
    android:icon="@drawable/ic_search"
    app:showAsAction="ifRoom" />
    <item
    android:id="@+id/action_music"
    android:tittle=""
    android:enabled="true"
    android:icon="@drawable/ic_search"
    app:showAsAction="ifRoom" />
    <item
    android:id="@+id/action_me"
    android:tittle=""
    android:enabled="true"
    android:icon="@drawable/ic_search"
    app:showAsAction="ifRoom" />
    

    In Bottom navigation view

     <android.support.design.widget.BottomNavigationView
        android:background="@color/whiteColor"
        android:id="@+id/bottom_navigation_bar"
        android:layout_weight="1.5"
        android:paddingTop="16dp"
        app:menu="@menu/menu_bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="0dp">
    
    0 讨论(0)
提交回复
热议问题