2011-08-21 106 views
0

我正在尝试使用ActionSheet向用户展示几个选项以继续。我想在屏幕中间添加一个简单的文本框来向用户描述问题。
有没有一个简单/标准的方式来在Sencha-Touch中提供这样的提示?sencha-touch using ActionSheet

回答

2

你需要做这样的事情在你的覆盖...

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(); 

记在纸张处理叠加的隐藏..(我不这样做上述但你更可能要摧毁覆盖和动作片,他们都隐藏后也只是以保持潮流)

+0

谢谢,那正是我一直在寻找的。 –

+0

谢谢..我投票了 –

0

您可以使用Overlay弹出窗口在ActionSheet呈现后显示消息。

+0

我尝试使用覆盖,但它偷走了ActionSheet的焦点,当我第一次点击其中一个按钮时,叠加层消失,并且点击处理程序未被调用,直到第二次点击。 –