使用 TTURLAction 在 Three20 中更好的 NavigationController 转换 [英] Better NavigationController transition in Three20 using TTURLAction

查看:25
本文介绍了使用 TTURLAction 在 Three20 中更好的 NavigationController 转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码在我的 Three20 应用程序中切换控制器

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];

但是过渡很奇怪,而且从来没有像默认的 Three20 过渡那样平滑,例如从 TTTableViewController 移动到 TTViewController

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

  1. 谁能提供更好的代码以实现更平滑的过渡?

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

是否可以只在 NavigationController 和 TabBar 之间传输内容?(我的意思是保持现有 NavigationController 中的按钮不被触摸)

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

谢谢.

推荐答案

您实际上是在制作两次动画.首先你告诉three20通过[urlAction applyAnimated:YES];应用动画,然后你附加你自己的动画.

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.

删除 applyAnimated: 并且它工作得很好.在 iOS5 模拟器和设备上使用 Three20 1.0.11 进行测试.

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

使用 [TTNavigator navigator].topController 而不是 self.navigationController 来获取将显示 url 的控制器可能很聪明.在某些情况下,这可能会有所不同.

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.

这篇关于使用 TTURLAction 在 Three20 中更好的 NavigationController 转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆