Titanium Community Questions & Answer Archive

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

Tabgroup as starting point required?

My mobile application doesn't require a tabgroup as used in all examples I could find so far. I would rather like to use one single root window and take it from there. (Q #1: Does this make even sense?)
While I can create and open my window from within app.js, I can't seem to get transition effects to work nor does my page show a nav. bar. (Q #2: Any ideas on how to this to work as expected?)

Thanks a lot in advance!

— asked March 18th 2010 by Florian Plank
  • animation
  • mobile
  • navbar
  • open
  • transition
  • window
0 Comments

4 Answers

  • I experimented a fair bit with various options and found that the best way WAS to include a tabgroup with one tab, but then to hide the tabBar and NavBar on the home screen. This was my app.js:

    var win1 = Titanium.UI.createWindow({ 
          url:'main.js', 
        title:'Back',
        backgroundImage:'./images/bg.png',
        navBarHidden: true,
        tabBarHidden: true
    });
    
    var tab1 = Titanium.UI.createTab({  
        title:'Main',
        window:win1
    });
    
    var tabGroup = Titanium.UI.createTabGroup();
    tabGroup.addTab(tab1);  
    tabGroup.open();
    

    Then from a button click event on the homescreen I can launch a new window:

    var win2 = Titanium.UI.createWindow({
        url:"news.js", 
        title:"news",  
        navBarHidden: false});
    Titanium.UI.currentTab.open(win2,{animated:true});
    

    This then has the standard left-right animation and a back button in the nav bar. All the time the tabBar is hidden so plays no part - but we do get access to the currentTab object which allows us to slide the windows in correctly.

    Not sure if this is the correct method in this case - I know many apps don't have tab bars so maybe if there is a better way we could have an example…?

    — answered March 18th 2010 by Paul Burrowes
    permalink
    0 Comments
  • Thanks for your reply Paul.
    Funny enough, this is the exact solution I'm currently using, but I'm just not happy with including a "dummy tab" and am as well wondering if this would pass Apple's check.
    Btw.: What is the correct way to use e.g. a flip animation as transition between two windows, which aren't parent and child view?

    Cheers!

    — answered March 18th 2010 by Florian Plank
    permalink
    0 Comments
  • Thanks for your reply Paul.
    Funny enough, this is the exact solution I'm currently using, but I'm just not happy with including a "dummy tab" and am as well wondering if this would pass Apple's check.
    Btw.: What is the correct way to use e.g. a flip animation as transition between two windows, which aren't parent and child view?

    Cheers!

    — answered March 18th 2010 by Florian Plank
    permalink
    0 Comments
  • Here's an example of how to start your main window without a tab view:

    http://github.com/kwhinnery/Snapost/blob/master/1.1.x/Snapost/Resources/app.js

    — answered June 17th 2010 by Daniel Tome
    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.