How to change text padding in android bottom navigation view

时光总嘲笑我的痴心妄想 提交于 2019-12-12 10:31:37

问题


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:

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/43386768/how-to-change-text-padding-in-android-bottom-navigation-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!