【问题标题】:How to change inactive color icon on BottomBar如何更改底部栏上的非活动颜色图标
【发布时间】:2017-02-03 23:22:06
【问题描述】:

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

bottomBar.setActiveTabColor

但我不知道如何更改非活动颜色。我搜索了很多,但找不到方法。

【问题讨论】:

    标签: android colors navigation bottombar


    【解决方案1】:

    如果 bottomBar 是一个视图,那么它应该是 backgroundcolor 属性 android:background="@color/white" 详情

    How to change background color in android app

    【讨论】:

      【解决方案2】:

      如果您使用的是BottomBar 库,那么有一个方法:

      public void setInActiveTabColor(@ColorInt int color)

      【讨论】:

        【解决方案3】:

        当您使用Roughike's bottombar 时,您可以使用以下行设置特定选项卡的背景颜色:

        bottomBar.getTabAtPosition(0).setBackgroundColor(backgroundColorInt);
        

        当你为每个标签多次使用这条线时,你可以改变整个标签的背景色。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-12-12
          • 1970-01-01
          • 2014-05-11
          • 1970-01-01
          • 1970-01-01
          • 2020-08-11
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多