2012-05-25 36 views
3

我正在嘗試更改面板的背景顏色。更改sencha觸摸面板的背景顏色

請參閱代碼:

panel: { 
      centered: true, 
      width: 200, 
      height: 150, 
      style: 'background-color: red', 
      fullscreen: false, 
      hidden: true, 
      zIndex: 10, 

     } 

風格: '背景色:紅色'語句不符合我的要求。它改變了面板邊框的顏色只是沒有完成面板背景顏色。

請爲相同的建議。

謝謝!

回答

4

這個工作對我來說在2.0.0:

Ext.application({ 
    launch : function() { 
     Ext.Viewport.add([{ 
      xtype: 'panel', 
      style: 'background-color:#F00' 
     }]); 
    } 
}); 
0

此鏈接:http://www.sencha.com/forum/archive/index.php/t-108823.html

表明,背景色是其自己的實體。我從來沒有真正使用過Sencha,但是我正在與之合作的一個團隊曾考慮過使用它。

panel: { 
     centered: true, 
     width: 200, 
     height: 150, 
     background-color: red, 
     fullscreen: false, 
     hidden: true, 
     zIndex: 10, 

    } 

此外,我不知道這是否是你不使用的舊版本。

+1

是的,這是煎茶的舊版本,我使用煎茶2.0版本。我在我的代碼中使用了相同的東西,但它不起作用。無論如何感謝共享! –