iphone: How to do kCATransitionPush without any fade? [duplicate]

怎甘沉沦 提交于 2019-12-01 06:52:08

问题


Possible Duplicate:
iPhone CATransition adds a fade to the start and end of any animation?

I want an animation of push between two sub views, just like ScrollView paging mode.

I know I can use UIScrollView directly, but the logic there is not so same with my program.

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??

or how to do a UIScrollView-like paging pushing between two sub views?

Thanks very much.


回答1:


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


来源:https://stackoverflow.com/questions/3505413/iphone-how-to-do-kcatransitionpush-without-any-fade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!