Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottom Navigation View menu item title size

Good Morning,

i am using bottom navigation view to do my bottom menu.

and now the title is too big and i can't found any solution to solve it

enter image description here

like image 509
JsLaw Avatar asked Apr 21 '17 03:04

JsLaw


People also ask

How do I change the bottom navigation bar?

To create a Menu Resource File , click on the app -> res -> menu(right-click) -> New -> Menu Resource File and name it bottom_nav_menu. Now the user can create as many items as he wants in the bottom_nav_menu. xml file. The user also needs to create an icon for each of these items.

How do I add more than 5 items in BottomNavigationView?

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.

How do I hide the bottom navigation title in Android?

Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


2 Answers

  1. Open values\dimens.xml
  2. add this code

    <dimen 
          name="design_bottom_navigation_text_size"   
          tools:override="true">11sp </dimen>
    
    <dimen 
          name="design_bottom_navigation_active_text_size" 
          tools:override="true">12sp </dimen>
    
like image 152
A.G.THAMAYS Avatar answered Nov 15 '22 11:11

A.G.THAMAYS


 <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="64dp"
        android:layout_gravity="bottom"
        android:background="@color/bg_grey"
      app:itemTextAppearanceActive="@style/BottomNavigationView.Active"
        app:itemTextAppearanceInactive="@style/BottomNavigationView"
        app:itemTextColor="@color/bottom_nav_color"
        app:labelVisibilityMode="labeled"
        app:menu="@menu/bottom_navigation_menu" />

styles.xml

<style name="BottomNavigationView" parent="@style/TextAppearance.AppCompat.Caption">
    <item name="android:textSize">10sp</item>
</style>

<style name="BottomNavigationView.Active" parent="@style/TextAppearance.AppCompat.Caption">
    <item name="android:textSize">11sp</item>
like image 42
Raviraj Avatar answered Nov 15 '22 12:11

Raviraj