How to change toolbar text color from MaterialComponents.DayNight theme?

后端 未结 5 1684
萌比男神i
萌比男神i 2021-02-20 17:58

I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it\'

5条回答
  •  悲哀的现实
    2021-02-20 18:07

    Add this entry to your theme:

    @style/PopupMenuTextAppearance
    

    After that, add the style accordingly to the styles.xml:

    
    

    ?attr/colorOnBackground is available in the Material Components library. If you're not using that, you should be able to use ?android:attr/textColorPrimary instead.

提交回复
热议问题