0
我需要以编程方式更改上下文操作栏颜色。如何以我知道的风格去做。谢谢你在前进如何以编程方式更改上下文操作栏颜色?
我需要以编程方式更改上下文操作栏颜色。如何以我知道的风格去做。谢谢你在前进如何以编程方式更改上下文操作栏颜色?
使用代码
getActionBar().setBackgroundDrawable(<create a background drawable with solid rectangle and color as what you want>);
如果您正在使用支持库,然后用
getSupportActionBar().setBackgroundDrawable(<create a background drawable with solid rectangle and color as what you want>);
不,它只改变Action Bar的颜色 –
这是不是针对动作模式,只针对动作条 –
的可能重复尝试[如何自定义材质设计使用程序兼容性的语境操作栏] (http://stackoverflow.com/questions/27458421/how-to-customize-the-contextual-action-bar-using-appcompat-in-material-design) –