Take the 2-minute tour ×

Developing in Titanium Mobile (latest SDK)

I have a navigationGroup with navBarHidden set to true. Within my windows, I have custom Back and Next buttons. The next button is obviously a cake walk, as it just opens a new window within the navigation group.

My question is the back button. How can I give my back button the same functionality as the default back button which iOS automatically adds to a navigationGroup?

share|improve this question
can't your 'back' button just close the window? That should remove the window from your navigationGroup stack. –  Jeff Bonnes Jan 10 '12 at 10:12
add comment

1 Answer

Why you are hiding your navbar?

you declare a navigation group like this:

  var nav = Titanium.UI.iPhone.createNavigationGroup({
  window: win1 //win1 is window defined above


Now suppose you have win2(another window) on which you navigate. so while opening that win2 just do like this


by doing this the titanium will automatically add a back button on the top.


you can do like this if you dont want that automatic back button

 var win = Titanium.UI.currentWindow;
 var b = Titanium.UI.createButton({title:'Back'});
 win.leftNavButton = b;
    b.addEventListener('click', function()
       alert('I was clicked'); // to confirm its being called
    // do the stuff here
share|improve this answer
I have a custom back button within the main UI. win.close(), while it closes the window, doesn't bring back the previous window, nor does the right to left animation exist, like a standard back button. –  Chris Jan 14 '12 at 20:48
before closing that window i.e before using win.close() you have to load your screen.. –  Ajeet Pratap Maurya Jan 16 '12 at 5:28
add comment

Your Answer


