Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked November 2nd 2010 by Josh Lewis
  • iphone
  • modal
  • transition
0 Comments

2 Answers

  • the original window definition is wrong… you should define modal: true when creating the window

    
        var w = Titanium.UI.createWindow({
            title:'Add Location',
            backgroundColor:'#000000',
            opacity:1,
            barColor:'#000000',
            modal: true // <--- change
        });
    
    — answered November 9th 2010 by Aaron Saunders
    permalink
    0 Comments
  • 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.

    — answered November 9th 2010 by Josh Lewis
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.