如何在钛金属中创建弹出屏幕

时间:2013-09-05 00:38:42

标签: titanium titanium-mobile

我可以创建窗口,我在其中创建标签+文本字段+按钮并打开该窗口。

现在我想制作一个弹出屏幕,其中我有一个标签和一个文本字段和两个按钮取消或确定。当我从窗口按钮点击时,弹出屏幕显示。你建议我怎么做任务?

var infoWin = Titanium.UI.createWindow({
    backgroundColor: 'pink',
    top: 0,
    left: 0,
    width:200,
    height:200,
    opacity: 1,
    zIndex: 100
});

 var vw=Titanium.UI.createView({


 });
 var lab= Titanium.UI.createLabel({

    text:"ooooooo"

 });
 vw.add("lab");
 infoWin.add(vw);
infoWin.open({modal:true});

我在添加语句时遇到错误,我在按钮点击时使用了这个

1 个答案:

答案 0 :(得分:0)

你的问题有点不清楚。你的意思是你想要一个模态窗口弹出?如果是这样,你就是这样做的:

button.addEventListener('click', function(e) {
    // Create the window
    var popup = Ti.UI.createWindow();
    ... Add all your buttons here ...

    // Now open the window
    popup.open({ modal : true });
});
相关问题