Modal Transitions not working, is my syntax wrong?
In my app, I am adding the functionality to create a window in a button in the nav bar to help develop for cross-development. However, all it does is slide up, no matter what I do.
AddSavedButtoniPhone.addEventListener('click',function(e)
{
/*
var newwin = Ti.UI.createWindow({ url:'map_view.js' });
newwin.open({modal:true,style:Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL});
*/
var w = Titanium.UI.createWindow({
//backgroundImage:'stripes.png',
title:'Add Location',
backgroundColor:'#000000',
opacity:1,
barColor:'#000000',
url:'addlocation.js'
});
//Titanium.UI.currentTab.open(w,{animated:true});
w.open({modal:true,style:Ti.UI.iPhone.MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL});
});
To be honest, I'd rather open it in the tab, but the currentTab.open doesnt seem to work (this is in my app.js) file.
Am I doing something wrong?
2 Answers
-
the original window definition is wrong… you should define
modal: true
when creating the windowvar w = Titanium.UI.createWindow({ title:'Add Location', backgroundColor:'#000000', opacity:1, barColor:'#000000', modal: true // <--- change });
-
Ok. What if I dont want it modal though, just a regular window? I can take out the modal part in my open, but that didnt work before either.