Selected tab's color in Bottom Navigation View

前端 未结 10 1980
故里飘歌
故里飘歌 2020-11-28 03:47

I\'m adding a BottomNavigationView to a project, and I would like to have a different text (and icon tint) color for the selected tab (to achieve greying out no

10条回答
  •  Happy的楠姐
    2020-11-28 03:56

    BottomNavigationView uses colorPrimary from the theme applied for the selected tab and it uses android:textColorSecondary for the inactive tab icon tint.

    So you can create a style with the prefered primary color and set it as a theme to your BottomNavigationView in an xml layout file.

    styles.xml:

     
    

    your_layout.xml:

    
    

提交回复
热议问题