如何在Android中增加底部导航视图的高度以及其图标和文本的大小?

问题描述:

我正在使用

compile 'com.android.support:design:25.0.0'

Android底部导航视图,其高度是固定的,并显示带有小文本的小图标. 我的问题是如何增加它们的尺寸? 我试图通过样式更改xml文件中的大小...除textsize属性外,所有其他属性都有效.

Android Bottom Navigation View and its height is is fixed and tiny icons with small text are shown. My question is how can i increase their sizes? I've tried to change size in xml file through style... all other properties are working except textsize property.

如果可以的话,我可以实用地这样做吗,请写一个代码

Can i do that pragmatically if so, then please write a code

我发现了一种解决方案,可以覆盖dimens.xml文件中的某些dimen值,该值适用于文本大小,但是图标仍然很小. 这是我的方法.希望这段代码也能对其他人有所帮助:-)

I've found a solution to override some dimen values in dimens.xml file it works for the text size but icon still remains tiny. Here is how i do that. Hope this code will help others too :-)

<!-- Overriding Default Bottom Navigation sizes-->
    <dimen name="design_bottom_navigation_text_size" tools:override="true">16sp</dimen>
    <dimen name="design_bottom_navigation_active_text_size" tools:override="true">20sp</dimen>
    <dimen name="design_bottom_navigation_height" tools:override="true">70dp</dimen>