Android Material Design - How to change background color of Toolbar after CollapsingToolbarLayout is collapsed

前端 未结 6 1841
情歌与酒
情歌与酒 2020-12-07 22:54

After the user scrolls down the screen, the image in the CollapsingToolbarLayout disappears and is left with a toolbar with the back button, content title,

6条回答
  •  情话喂你
    2020-12-07 23:27

    Just use CollapsingToolbarLayout XML attribute contentScrim to set Toolbar background color when it's in collapsed mode.

    app:contentScrim="YOUR_TOOLBAR_COLOR"

    Here is an Example:

    
    
        
    
        
    
    

    Hope this will help~

提交回复
热议问题