Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change text padding in android bottom navigation view

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

like image 466
jjjjjjjj Avatar asked Apr 13 '17 08:04

jjjjjjjj


1 Answers

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.

like image 153
Sarath DR Avatar answered Sep 29 '22 06:09

Sarath DR