底部导航图标颜色变化
问题描述:
我正在使用底部导航this当我尝试更改底部导航图标颜色与黑色背景它不会更改颜色。底部导航图标颜色变化
bottomNavigation.setAccentColor(Color.parseColor("#FFE4770A"));
bottomNavigation.setInactiveColor(Color.WHITE);
bottomNavigation.setBackgroundColor(Color.BLACK);
但是,当我试着它与背景它改变图标颜色。
bottomNavigation.setAccentColor(Color.parseColor("#FFE4770A"));
bottomNavigation.setInactiveColor(Color.WHITE);
如何解决?它会更改带有彩色背景的图标颜色。
答
根据ahbottomnavigation回购文档,setBackgroundColor()
将覆盖图标的重音颜色。
与setDefaultBackgroundColor()
更换setBackgroundColor()
:
bottomNavigation.setDefaultBackgroundColor(Color.BLACK);
尝试使用'setDefaultBackgroundColor()',而不是'setBackgroundColor()' – Mithun