问题描述
可能重复:结果
iPhone CATransition增加了一个褪色的任何动画的起点和终点?
我要推的两个子观点,就像滚动型分页模式间的动画。
I want an animation of push between two sub views, just like ScrollView paging mode.
我知道我可以直接使用的UIScrollView,但逻辑没有与我的计划,以便同。
I know I can use UIScrollView directly, but the logic there is not so same with my program.
不过,我可以用kCATransitionPush动画,不过那坏事,同时推动它不褪色。
Anyway, I can use kCATransitionPush animation, but the bad thing of that is it does fading while pushing.
我真的很讨厌那个褪色,任何人都可以请告诉我如何删除褪色??
I really hate that fading, can anyone pls tell me how to remove that fading??
或如何做一个UIScrollView般的传呼两个子视图之间推?
or how to do a UIScrollView-like paging pushing between two sub views?
非常感谢。
推荐答案
只需使用普通的UIView动画。您可以使用基于块的动画,但我preFER传统的风格,因为它可以在3.0:
Just use normal UIView animations. You can use block-based animations, but I prefer the "traditional" style since it works on 3.0:
CGRect pageFrame = currentPage.frame;
CGFloat pageWidth = pageFrame.size.width;
nextPage.frame = CGRectOffset(pageFrame,pageWidth,0);
[UIView beginAnimations:nil context:NULL];
currentPage.frame = CGRectOffset(pageFrame,-pageWidth,0);
nextPage.frame = pageFrame;
[UIView commitAnimations];
这篇关于iPhone:如何做kCATransitionPush没有任何褪色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!