Ext.application({
name: 'MyApp',
launch: function(){
//this is the Panel we'll be adding below
Ext.Viewport.add({
xtype: 'button',
centered: true,
text: 'My Button',
listeners: {
tap: function() {
Ext.Msg.alert("You tapped me");
}
}
});
}
});
Tap 是 触摸的监听
**点击先隐藏 然后过1秒后显示
Ext.application({
name: 'MyApp',
launch: function(){
//this is the Panel we'll be adding below
Ext.Viewport.add({
xtype: 'button',
centered: true,
text: 'My Button',
listeners: {
tap: function() {
this.hide();
},
hide: function() {
//waits 1 second (1000ms) then shows the button again
Ext.defer(function() {
this.show();
}, 1000, this);
}
}
});
}
});
本文展示了一个使用Sencha Touch框架创建的简单按钮示例,该按钮能够在被点击后隐藏自身,并在一秒钟后重新出现。文章通过Ext.application配置对象定义了一个名为“MyApp”的应用程序,并在Viewport中添加了一个居中的按钮。
1834

被折叠的 条评论
为什么被折叠?



