Custom TextSize of BottomNavigationView support android

前端 未结 8 1290
别跟我提以往
别跟我提以往 2020-12-12 23:53

I am trying to change the textSize of BottomNavigationView from android support library 25.0.0



        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 00:22

    You can change BottomNavigationView text appearance by defining your own styles for Component Attributes itemTextAppearanceActive and itemTextAppearanceInactive. By default they have textAppearanceCaption check section Theme Attribute Mapping in the docs Bottom Navigation.

    
    

    styles.xml

    
    
    
    
    • Next, Change Text Color selected and icon:
      Just Create bottom_nav_icon_color_selector & bottom_nav_text_color_selector on drawable to edit default value.

    • For change icon color - bottom_nav_icon_color_selector.xml

    
    
         
         
         
    
    
    • For change text color - bottom_nav_text_color_selector.xml
    
    
         
         
         
    
    
    • Note : @color/colorIconInActive is a color disable/inactive, you can set this color in your res-values-colors
    • Finish, try to see, your navigation bottom. color icon and text will be change.

提交回复
热议问题