views:

320

answers:

1

To explain what I'm trying to do:

I have a navigationController with a list of options, clicking one will do the usual push of the selected TableViewController subclass, sliding the screen to the left, displaying the usual "back" button and view title on the top. so far so good.

This view is showing content for a specific day. Lets call the view controller OneDayViewController. I will have on the view buttons "earlier" and "later" in a single cell in a group of this table view. in another group I will have rows of content in cells; clicking one pushes onto the navigationController a viewContoller for this content item. Standard stuff.

Problem is the Earlier and Later buttons. One route could be this,
http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically

where you use UIViewAnimationTransitionFlipFromRight etc to run an animation when switching views. I think with this approach I would be pushing onto the navcontroller first a UIViewController subclass containing two TableViewController subclasses that I switch between. But what about the NavBar of the NavController? how would that be affected by the pageflip? And really I'm interested in having the view slide, like when the view is pushed on the navcontroller stack. Except I would want the "previous" button to start the new view in from the left. Or maybe this approach would be troubling to the Interface Guideline police....

Thoughts are much appreciated.

+1  A: 

Here's how I've done this before: http://stackoverflow.com/questions/883596#1736329

Basically, create a second tableview offscreen, then transition the frames of both of them simultaneously, so that it looks like one is sliding out and the other is sliding in to replace it.

Dave DeLong
Great! And simple. As a Flash programmer I should have thought of this, but one gets so wrapped up in the iphone sdk trying to find the prefab solution. Thanks Dave.
ransomweaver
I recently did this same thing, but I only wanted the cells themselves to animate -- I didn't want the background to move as well. Although it took about an hour messing with core animation, I finally found a simple and effective solution that looks great, if you're interested
Ian Henry
So stuff like the buttons and maybe a label stay in place, and the table view is what moves? Sounds cool, do tell!
ransomweaver
@ransomweaver - the tableviews and any subviews will move.
Dave DeLong
@dave sorry, I meant re: Ian's comment.
ransomweaver