如何在Android中增加底部导航视图的高度以及其图标和文本的大小? [英] How to increase Bottom Navigation View height along with its icon and text sizes in android?

查看:186
本文介绍了如何在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>

这篇关于如何在Android中增加底部导航视图的高度以及其图标和文本的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆