Better NavigationController transition in Three20 using TTURLAction

风格不统一 提交于 2019-12-12 02:47:42

问题


I am using the following codes to switch controller in my Three20 App

TTURLAction * urlAction = [TTURLAction actionWithURLPath:url];
[urlAction applyAnimated:YES];

CATransition * transition = [CATransition animation];
transition.duration = 0.4f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionReveal;
transition.subtype = kCATransitionFromRight;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[[TTNavigator navigator] openURLAction:urlAction];

But the transition is strange and never as smooth as the default Three20 transition, e.g. Move from TTTableViewController to TTViewController

  1. Any one can provide a better codes for a smoother transition?

  2. Is it possible to transit only the content between NavigationController and TabBar? (I mean keep the button in existing NavigationController un-touched)

Thanks.


回答1:


You are in fact animating twice. First you tell three20 to apply animation by [urlAction applyAnimated:YES]; and then you are attaching your own animation.

Remove applyAnimated: and it works just fine. Tested with Three20 1.0.11 on iOS5 Simulator and device.

It might be clever to use [TTNavigator navigator].topController instead of self.navigationController to get the controller which will present the url. This might be an different one under some circumstances.



来源:https://stackoverflow.com/questions/9226340/better-navigationcontroller-transition-in-three20-using-tturlaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!