Android 如何更改底部栏上的非活动颜色图标

Android 如何更改底部栏上的非活动颜色图标,android,colors,navigation,bottombar,Android,Colors,Navigation,Bottombar,我可以使用以下代码更改活动颜色: bottomBar.setActiveTabColor 但我不知道如何改变不活跃的颜色。我搜索了很多,但是我找不到一个方法来完成它。如果底部栏是一个视图,那么它应该是backgroundcolor属性 android:background=“@color/white” 细节 如果底部栏是一个视图,那么它应该是backgroundcolor属性 android:background=“@color/white” 细节 如果您正在使用库,则有一种方法: 如果您正在

我可以使用以下代码更改活动颜色:

bottomBar.setActiveTabColor

但我不知道如何改变不活跃的颜色。我搜索了很多,但是我找不到一个方法来完成它。

如果底部栏是一个视图,那么它应该是backgroundcolor属性 android:background=“@color/white” 细节


如果底部栏是一个视图,那么它应该是backgroundcolor属性 android:background=“@color/white” 细节

如果您正在使用库,则有一种方法:

如果您正在使用库,则有一种方法:

使用时,可以使用以下行设置特定选项卡的背景色:

bottomBar.getTabAtPosition(0).setBackgroundColor(backgroundColorInt);
当您对每个选项卡多次使用此行时,您可以更改整个选项卡的背景色。

使用时,您可以使用以下行设置特定选项卡的背景色:

bottomBar.getTabAtPosition(0).setBackgroundColor(backgroundColorInt);
当您对每个选项卡多次使用此行时,可以更改整个选项卡的背景色