Titanium Community Questions & Answer Archive

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

see and no see windows on iphone flip

how can i make window not see if i flip iphone?

tnx

— asked March 30th 2010 by Milan Dzuzak
  • flip
  • window
0 Comments

2 Answers

  • Accepted Answer

    try this:

    Ti.Gesture.addEventListener('orientationchange',function(e) {
        // get orienation from event object
        var orientation = e.orientation
    
        switch (orientation)
        {
            case Titanium.UI.PORTRAIT:
                window1.show();
                window2.hide();
                win.showNavBar();
                break;
    
            case Titanium.UI.LANDSCAPE_RIGHT:
                window1.hide();
                window2.show();
                win.hideNavBar();
                break;
    
                case Titanium.UI.LANDSCAPE_LEFT:
                window1.hide();
                window2.show();
                win.hideNavBar();
                break;
        }
    });
    
    win.orientationModes = [
        Titanium.UI.PORTRAIT,
        Titanium.UI.LANDSCAPE_RIGHT,
        Titanium.UI.LANDSCAPE_LEFT
    ];
    
    — answered March 30th 2010 by Glenn Tillemans
    permalink
    0 Comments
  • tnx worked

    — answered March 30th 2010 by Milan Dzuzak
    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.