10

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

JsLaw
  • 153
  • 1
  • 3
  • 17

3 Answers3

35
  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>
    
Aditya
  • 3,525
  • 1
  • 31
  • 38
Thamays
  • 2,978
  • 26
  • 31
6
 <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>
</style>
Fakhriddin Abdullaev
  • 4,169
  • 2
  • 35
  • 37
Raviraj
  • 906
  • 9
  • 14
-1

Create new style

<style name="NavigationViewOwnStyle">
 <item name="android:listPreferredItemHeightSmall">40dp</item><!-item height-->
 <item name="android:textSize">20sp</item> <!--item text size-->
</style>

and apply

<android.support.design.widget.NavigationView
    ...
    ...
    app:itemTextAppearance="@style/NavigationViewOwnStyle"
    ...
    ...
 />
Israel
  • 436
  • 3
  • 12