Titanium Community Questions & Answer Archive

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

HowTo: Custom back button in TableView

I am overriding the back button in a window opened from a TableView via:

window.setLeftNavButton(cancelButton);

I am doing this so I can do special processing before allowing the user to exit back to the TableView.

I am "exiting back to the TableView" via:

window.close();

This all works great. The problem is that using this code I no longer see the default TableView animation whereby the TableView window is slid in from the left and the current window slid out to the right.

What I see is that the current window is hidden entirely and then the TableView animation happens. So, basically I see a black screen (my app's backgroundColor) and then the TableView sliding in from the left as the black screen slides out to the right.

I'm assuming this is because I'm calling window.close().

Is there another/better way to hook custom behavior onto the "back" button without the blank screen behavior?

— asked May 25th 2010 by Donnie Tognazzini
  • back
  • bar
  • button
  • navbar
  • navigation
  • tableview
0 Comments

2 Answers

  • I was reading a Q&A post recently where you can apply a transition to the close method - much like you do with open. You can try something along those lines.

    — answered May 25th 2010 by David Ashwood
    permalink
    0 Comments
  • @David

    Yeah, I tried an animation on close. Unfortunately, Titanium waits for the window to be completely out of view before sliding in the previous window of the TableView. So basically, this doesn't seem possible in Titanium.

    I suppose I could try using a NavigationGroup, but to be honest I doubt that would work either as both of these classes are built from the same underlying iPhone class: UINavigationController (well, TableView is a UITableViewController wrapped in an UINavigationController).

    Oh well….

    — answered May 29th 2010 by Donnie Tognazzini
    permalink
    1 Comment
    • Did you manage to solve this is Donnie? I'm having trouble with it.

      — commented March 9th 2011 by Scott Millar
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.