2014-01-18 32 views
0

快速問題,我一直在嘗試更改我的Sencha Touch視圖的背景顏色和背景圖像,但似乎我無法正確實施此操作。即使添加使用CLS CSS類Sencha Touch 2應用程序中的自定義CSS

extend:'Ext.form.Panel', 
requires: ['Ext.form.FieldSet', 'Ext.form.Password', 'Ext.Label', 'Ext.Img'], 
    alias: 'widget.loginview', 
style:{ 
    background: '#000' 
}, 
config:{ 
    title: 'Login', 

而且:

我已經試過這樣:

extend:'Ext.form.Panel', 
requires: ['Ext.form.FieldSet', 'Ext.form.Password', 'Ext.Label', 'Ext.Img'], 

config:{ 
    title: 'Login', 
    style: { 
     background: "#000" 
    }, 

extend:'Ext.form.Panel', 
requires: ['Ext.form.FieldSet', 'Ext.form.Password', 'Ext.Label', 'Ext.Img'], 
config:{ 
    title: 'Login', 
    cls: 'custom-panel', 

其中定製面板的定義作爲:

.custom-panel{ 
    background-image: url('../images/bg.jpg'); 
} 

我該如何做這項工作?

+0

baseCls屬性insteed嘗試把!重要的。 –

+0

恐怕它沒有解決掉 – user1659653

回答

3

試着用的cls

extend:'Ext.form.Panel', 
requires: ['Ext.form.FieldSet', 'Ext.form.Password', 'Ext.Label', 'Ext.Img'], 
config:{ 
    title: 'Login', 
    baseCls: 'custom-panel', 
+0

太棒了。非常感謝。 – user1659653

相關問題