How to change text padding in android bottom navigation view

joey picture joey · Apr 13, 2017 · Viewed 10.4k times · Source

I am using the bottom navigation view for an android app. I have increased the size of my icon, but now the icon runs over the text. Here is what I see:

enter image description here

Here is a diagram of the bottom navigation view according to google design docs:

enter image description here

The number 10, I want to change that padding, but when I look in the properties for the navigation bar, I don't see where I can do it. How can I change it to a smaller number? In my bottom_layout.xml I am setting my items up like so:

<item
    android:id="@+id/menu_notifications"
    android:title="Professionals"
    android:icon="@drawable/ic_action_name"
    app:showAsAction="ifRoom"
    />

How can I change the bottom text padding?

thanks

Answer

Sarath DR picture Sarath DR · Jun 15, 2018

You change the height of BottomNavigationView by overriding the below dimension

<dimen name="design_bottom_navigation_height" tools:override="true">52dp</dimen>

This will increase the height and bring down the text to avoid overlapping.