AppCompat style background propagated to the Image within the ToolBar

前端 未结 2 1335
别那么骄傲
别那么骄傲 2020-12-04 14:56

Context

I\'m using the newest AppCompat v7 lib (21.0.0) and I have migrated my app from ActionBar to ToolBar

Problem

<
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 15:21

    You should not be using theme like that:

    • style = local to the Toolbar
    • theme = global to everything inflated in the Toolbar

    Workaround 2, as you call it, is kind of the correct way. If you want to extract some values into a style, you can do it as so:

    
    

    Style:

    
    

提交回复
热议问题