开发者

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

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

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

I want an an开发者_开发问答imation 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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜