AppCompat style background propagated to the Image within the ToolBar

前端 未结 2 1338
别那么骄傲
别那么骄傲 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:29

    Never use themes to edit. Because theme defines overall app behavior. U can use two methods for that

    Method:1

    U can directly specify the parameters in appbar.xml as shown below

    in appbar.xml

      
        
    

    Method:2

    you can use a style as Chris_Banes suggested in above post

    in appbar.xml:

    
    

    in Style:

    
    

    Points To Note

    With the new Toolbar you can apply a style and a theme. They are different! The style is local to the Toolbar view, for example the background color. The app:theme is instead global to all ui elements inflated in the Toolbar, for example the color of the title and icons.

提交回复
热议问题