2016-02-27 39 views
0

我需要以編程方式更改上下文操作欄顏色。如何以我知道的風格去做。謝謝你在前進如何以編程方式更改上下文操作欄顏色?

+1

的可能重複嘗試[如何自定義材質設計使用程序兼容性的語境操作欄] (http://stackoverflow.com/questions/27458421/how-to-customize-the-contextual-action-bar-using-appcompat-in-material-design) –

回答

-1

使用代碼

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>); 
+0

不,它只改變Action Bar的顏色 –

+0

這是不是針對動作模式,只針對動作條 –

相關問題