开发者

iphone tableviewcontroller left/right slide when switching views programmatically?

开发者 https://www.devze.com 2022-12-13 14:19 出处:网络
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 l

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,

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.


Here's how I've done this before: https://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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号