Coding style sencha touch::将背景图像添加到面板

Coding style sencha touch::将背景图像添加到面板,coding-style,background-image,sencha-touch,Coding Style,Background Image,Sencha Touch,我尝试将图像添加到面板的背景中。图像来自加载的数据。 我尝试了以下代码,但无效: var topPanel = new Ext.Panel({ flex:1, title:'topPanel', style:'style="background-image: url('+this.jsonData.picURL+');' }); 当我创建一个列表时,它与“itemTpl”配合得非常好 我也试过了 style:'background-image:

我尝试将图像添加到面板的背景中。图像来自加载的数据。 我尝试了以下代码,但无效:

var topPanel = new Ext.Panel({
        flex:1,
        title:'topPanel',
        style:'style="background-image: url('+this.jsonData.picURL+');'

});
当我创建一个列表时,它与“itemTpl”配合得非常好

我也试过了

style:'background-image: url({picURL});'
连同

store: {
            fields: ['firstName','lastName', 'picURL'],
            data: this.jsondData
        }
但后来我明白了

[[object]]不是有效的 论据 “Function.prototype.apply”

任何想法都有帮助!
thnx

通过将对象指定给面板的“样式”属性,可以附加自定义样式

style: {
            backgroundImage: 'url(resources/branding/mobile.gif)',
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center'
}

通过将对象指定给面板的“样式”属性,可以附加自定义样式

style: {
            backgroundImage: 'url(resources/branding/mobile.gif)',
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center'
}

如果您想涵盖整个背景,请使用:


backgroundSize:“cover”

如果您想覆盖整个背景,请使用:


backgroundSize:“cover”

我现在有一个变通方法,将图像放入“html”属性。我现在有一个变通方法,将图像放入“html”属性。