Modal window not working
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});