如何在Android底部导航视图中更改文本填充 [英] How to change text padding in android bottom navigation view
问题描述
我正在为Android应用程序使用底部导航视图。我已经增加了图标的大小,但是现在图标在文本上显示了。我看到的是这样:
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:
这是一个根据Google设计文档的底部导航视图的示意图:
Here is a diagram of the bottom navigation view according to google design docs:
数字10,我想更改该填充,但是当我在导航栏的属性中查找时,我看不到在哪里可以做到这一点。如何将其更改为较小的数字?在我的bottom_layout.xml中,我像这样设置项目:
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?
谢谢
推荐答案
通过覆盖更改 BottomNavigationView
的高度
<dimen name="design_bottom_navigation_height" tools:override="true">52dp</dimen>
这将增加高度并放下文本以避免重叠。
This will increase the height and bring down the text to avoid overlapping.
这篇关于如何在Android底部导航视图中更改文本填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!