Change Toolbar background color programmatically does not change Toolbar Title Background color

前端 未结 5 2168
南笙
南笙 2020-12-18 18:11

I´m trying to change the toolbar Background color programmatically by doing this:

getSupportActionBar().setBackgroundDrawable(newColorDrawable(getResources()         


        
5条回答
  •  青春惊慌失措
    2020-12-18 18:54

    Late, but I hope it would be helpful comment

    I had this item in my Activity style

    someColor
    

    so when I changed toolbar color, title and menu items didn't change background. I just removed this item and now it works perfect.

    I did not have time to understand the details, but I think it might be useful to someone else.

提交回复
热议问题