如何创建平滑的CATransition效果

时间:2010-05-03 00:39:58

标签: iphone uiview

我已经实现的CATransition工作得很好但不顺利,我可以在转换期间看到之前的uiview屏幕,我只是这样做,

CATransition *animation = [CATransition animation];
[animation setDuration:0.1];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

[[objView layer] addAnimation:animation forKey:@"SwitchToView"];

为了前进和后退病房,

CATransition *animation = [CATransition animation];
[animation setDuration:0.1];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[objRemovableView layer] addAnimation:animation forKey:@"SwitchToView"];

滑动的效果并不顺畅,还有其他方法我们可以做到这一点非常流畅吗?

请帮忙

2 个答案:

答案 0 :(得分:0)

在如此短的时间内无法制作足够的帧。

答案 1 :(得分:0)

尝试稍微增加动画的持续时间。现在是0.1秒。