AppCompat Toolbar: Change Overflow Icon Color in ActionMode

前端 未结 12 780
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 03:12

With the AppCompat Toolbar, I want to be able to change the color of the overflow menu icon on ActionMode change.

For example, the overflow icon will be white in normal

12条回答
  •  天涯浪人
    2021-01-31 03:57

    None of the answers here helped me change the overflow icon color of ActionMode independently from the overflow icon color of the normal Toolbar (without resorting to case-by-case styling in code). After some trial and error, I thought that we might override theme attribute of ActionMode independently from Toolbar, and it worked!

    In the base theme, we specify the style of action mode like usual:

    
    

    In our custom ActionModeStyle we do whatever styling we want, and also specify a theme attribute:

    
    
    
    

    textColorSecondary will also change the back button color, but we can easily override that one using actionModeCloseButtonStyle.

提交回复
热议问题