我对sencha touch有点问题。
当我点击一张图片时,我想隐藏其他图片
下面是我的代码:
config: {
fullscreen: true,
id: 'ViewEstimation',
styleHtmlContent: true,
items: [{
xtype:'panel',
layout:'vbox',
items:[
{
xtype:'panel',
layout:'hbox',
items: [
Image0,
Image1,
Image2,
Image3,
Image4,
Image5,
]
},
{
xtype:'panel',
layout:'hbox',
items: [
Image6,
Image7,
Image8,
Image9,
Image10,
Image11
]
},
]
}]
}我的图像在另一个文件中声明。下面是一个示例:
var Image0 = Ext.create('Ext.Img', {
src: 'mysource',
id: 'Image0',
width: 108,
height: 150
});我尝试在全局项目上创建事件,但无法检索图像id
有人能帮我吗??
发布于 2013-06-07 20:22:04
在您的控制器中,尝试使用以下内容:
config: {
ref: {
img: '#ViewEstimation image'
}
control: {
img: {
tap: 'onImageTap'
}
}
},
onImageTap: function(image) {
this.getImg.setHidden(true);
image.setHidden(false);
}希望能有所帮助。
https://stackoverflow.com/questions/16980383
复制相似问题