我正在尝试使用ActionSheet向用户显示几个选项以继续。我想在屏幕中间添加一个简单的文本框来向用户描述问题。
有没有一种简单/标准的方法来在Sencha-Touch中添加这样的提示?
发布于 2011-08-22 02:33:25
你需要在你的覆盖上做一些类似的事情...
if (!this.popup) {
this.popup = new Ext.Panel({
hideOnMaskTap: false,
floating: true,
modal: true,
centered: true,
hideOnMaskTap: false,
width: 300,
height: 200,
styleHtmlContent: true,
scroll: 'vertical',
html: '<p>msg here</p>'
});
}
this.popup.show('pop');这里的关键是hideOnMaskTap: false,这将防止当你点击它的遮罩区域时覆盖消失。
然后,您可以显示您的动作单,但您必须记住隐藏您的动作单按钮的处理程序中的覆盖,因为当您在蒙版区域中点击时,它将不再消失。
if (!this.actions) {
this.actions = new Ext.ActionSheet({
items: [{
text: 'decline',
ui: 'decline',
handler: function() {
this.doWhateverYouNeedToDo();
this.actions.hide();
this.popup.hide();
}
}, {
text: 'save',
handler: function() {
this.doWhateverYouNeedToDo();
this.actions.hide();
this.popup.hide();
}
}, {
text: 'cancel',
scope: this,
handler: function() {
this.doWhateverYouNeedToDo();
this.actions.hide();
this.popup.hide();
}
}]
});
}
this.actions.show();请注意,在工作表处理程序中隐藏了覆盖。(我没有在上面这样做,但是你很可能想要在它们被隐藏之后销毁覆盖和动作单,只是为了保持事情的整洁)
发布于 2011-08-21 22:45:11
您可以使用覆盖弹出窗口在ActionSheet呈现后显示一条消息。
https://stackoverflow.com/questions/7138899
复制相似问题