BottomNavigationView Original icon color

前端 未结 5 1854
孤独总比滥情好
孤独总比滥情好 2020-12-10 03:31

I have my bottomNavigationView :

And i added this class to prevent it from doing shiftingMode :

public class BottomNavigationViewHelper {
           


        
5条回答
  •  执笔经年
    2020-12-10 04:21

    Our use case was a multicolored icon when the tab is active and a grey one when it is not. Setting itemIconTintList to null made the inactive tab icons have the same colors as the active ones when using the material component BottomNavigationView.

    So we had to do this in addition:

    menu_bottom_navigation.xml:

    
    
        
        
    
    

    ic_first_tab_selector.xml:

    
    
        
        
    
    

    Where ic_first_tab_inactive.xml is the drawable for your inactive icon and ic_first_tab_active.xml is the drawable for your active icon.

提交回复
热议问题