Modal window not working

You must Login before you can answer or comment on any questions.

I am having a really hard time trying to get any of the modal windows to work in my app. I have copied the code exactly from Kitchen Sink, and it still does not work.

Here is the code I'm trying to use:

var adView = Ti.UI.createButton({
    title:'Button',
    width:320,
    height:60,
    opacity:1.0,
    left:0,
    top:400
});
 
adView.addEventListener('click', function()
{
 
    var w = Titanium.UI.createWindow({
        backgroundColor:'#336699'
    });
 
    // create a button to close window
    var b = Titanium.UI.createButton({
        title:'Close',
        height:30,
        width:150
    });
    w.add(b);
    b.addEventListener('click', function()
    {
        w.close();
    });
 
    w.open();
});
 
win1.add(adView);
When I click on the button, it does nothing. What am I doing wrong?

1 Answer

Accepted Answer

w.open({modal:true});

— answered 3 years ago by Daniel Lim
answer permalink
1 Comment
  • I've tried that, but it also did not work. If that were the case, wouldn't the kitchen sink example need to have that also? It works without that somehow.

    — commented 3 years ago by Travis Moore

Your Answer

Think you can help? Login to answer this question!