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) –