在iPhone中翻转过渡 [英] Flip transition in iPhone

查看:92
本文介绍了在iPhone中翻转过渡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone中查看视图时遇到问题。

I am facing problems in flipping views in iPhone.

我在appDelegate中有两个视图。我想在用户点击按钮后翻转它们。

I have two views in appDelegate. I want to flip them once user clicks on a button.

我有以下代码:

CATransition *transition = [CATransition animation];

transition.duration = 0.75;
[transition @"twist"];
[transition setSubtype:@"fromRight"];

transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[transition setFillMode:@"extended"];

[[window layer] addAnimation:transition forKey:nil];


[window addSubview:self.s.view];
[CATransaction commit];

但这不起作用。有没有人知道在窗口侧翻转视图的更好方法。

But this is not working. Do anybody knows a better way to flip the views on window side.

我正在做的是从各个viewControllers中的appDelegate调用方法来翻转视图。

What I am doing is calling the method from appDelegate in the respective viewControllers to flip the views.

推荐答案

参见元素示例代码。特别是 AtomicElementViewController -flipCurrentView

See The Elements sample code. Particularly AtomicElementViewController -flipCurrentView.

这篇关于在iPhone中翻转过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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