2014-09-10 73 views
0

我正在嘗試更改工具欄的背景顏色。現在,我有一個經典的主題。我希望工具欄背景顏色是深藍色,但是這種顏色變化不適用於所有正在創建的工具欄。有人能指導我如何做這件特別的事情嗎?如何更改ExtJS4中工具欄的背景色

在此先感謝..

+0

使用工具欄的cls配置並在css中設置背景:http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.toolbar.Toolbar-cfg-cls – newmount 2014-09-10 09:54:53

+0

Thanks @newmount can ü請給我提供一些參考資料,說明如何做到這一點。因爲我不熟悉使用CLS配置 – user777777 2014-09-10 10:02:56

回答

3

您也可以嘗試使用"style"配置選項。

Ext.define 'App.your_package.CustomToolbar', 
    extend: 'Ext.toolbar.Toolbar' 
    xtype: 'my-custom-toolbar' 
    style: 'background-color: #112D41;' 

乾杯!

1

使用CLS配置​​

Ext.create('Ext.toolbar.Toolbar', { 
    ..., 
    cls: 'myBgCls', 
    ... 

,然後CSS來改變背景:

.myBgCls{ 
    background: blue; 
} 
相關問題