87,992
社区成员
发帖
与我相关
我的任务
分享


Ext.require('Ext.Img');
Ext.require('Ext.MessageBox');
Ext.application({
name: 'myApp',
icon: 'images/icon.png',
glossOnIcon: false,
phoneStartupScreen: 'images/phone_startup.png',
tabletStartupScreen: 'images/tablet_startup.png',
launch: function() {
var img = Ext.create('Ext.Img', {
src: 'images/default.png',
width: 320,
height: 480,
// listeners:{
// tap: function(img, ev, o){
// Ext.Msg.alert('警告', '您点击了图片!', Ext.emptyFn);
// }
// }
});
var panel = Ext.create('Ext.Panel', {
id: 'myPanel',
cls: 'bgColorPink',
items: [img]
});
Ext.Viewport.add(panel);
// Ext.Msg.prompt('警告', '您点击了图片!', function(text){});
// 添加图片组建的tap事件处理函数
var handleTap = function(){
Ext.Msg.alert('警告', '您点击了图片!');
};
// 添加图片组建的tap事件的监听器并指定事件处理函数为handleTap函数
img.addListener('tap', handleTap, this, {
// img.on('tap', handleTap, this, {
//single: true,
delay: 1000
});
}
});