在 Three20 中使用 CATransition?
我希望在 TTNavigator 中实现 CATransitions,我知道该方法 openURL 可以采用 UIViewAnimationTransition 但这只给了我 翻转和卷曲动画,但通过 CATransition 我可以访问 到另外8个,其中kCATransitionFromRight,kCATransitionFromLeft, kCATransitionFromTop、kCATransitionFromBottom 是我的 特别是之后。
对于 UINavigationController 将使用类似这段代码的东西 让我更好地控制动画:
CATransition *transition = [CATransition animation];
transition.duration = 0.5f;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
[self.navigationController.view.layer addAnimation:transition
forKey:nil];
但是,此代码不适用于 TTNavigator。有谁知道吗 如何让我自己的自定义动画与 TTNavigator 一起使用?或者如果 我的代码做错了什么?
I am looking to implement CATransitions within TTNavigator, I know the method
openURL can take a UIViewAnimationTransition but that only gives me
flipping and curling animations, but with CATransition I have access
to another 8, of which kCATransitionFromRight, kCATransitionFromLeft,
kCATransitionFromTop, kCATransitionFromBottom are the ones I am
specifically after.
With a UINavigationController would use something like this piece of code to
give me more control over the animation:
CATransition *transition = [CATransition animation];
transition.duration = 0.5f;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
[self.navigationController.view.layer addAnimation:transition
forKey:nil];
This code however, doesn't work with TTNavigator. Does anybody know
how I can get my own custom animations to work with TTNavigator? Or if
I am doing something wrong in my code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
结果我回答了我自己的问题,但我没有使用最后一行代码在 navigationController 上设置动画,而是尝试设置到 URLAction 的转换。一旦我把那行放回去并注释掉 URLAction 转换代码,它似乎就可以工作了!
希望这对将来的其他人有帮助!
Turns out i answered my own question, but rather than using that last line of code to set the animation on the navigationController i was trying to set the transition to the URLAction. Once i put that line back in and commented out the URLAction transition code it seems to work!
Hope this helps someone else in the future!
您可以使用 TTLauncherView 轻松地在 TTNavigator 上添加翻转或任何其他类型的动画,如下所示:
这使得 TTNavigator 在显示新 URL 时使用动画过渡。
You can easily add flip or any other kind of animation on TTNavigator using TTLauncherView as follows:
This makes TTNavigator use animated transition while displaying new URL.