views:

222

answers:

1

Is it possible to turn a view slowly like turning a page? When i swipe from right to left, the current view will turn and the next view will be shown. And from left to right, the previous view will come slowly as we move the finger.

How can I do it? Any ideas??

A: 

You should add and remove subviews from your view by detecting the touch movements, using the animation transtion styles:

UIViewAnimationTransitionCurlUp //for removing views (vice-versa)
   UIViewAnimationTransitionCurlDown // for adding views (vice-versa)

like:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:NO];
[self.view addSubview:nextView];
[UIView commitAnimations];

You should customize above according to ur needs.

Hope this helps.

Thanks,

Madhup

Madhup
I knew about this effect. Here its curling up and down. But i actually wanted the page to curl left and right. I think its done using cocos2D. I think there is no way in the sdk to do it. Thanks for the answer.
wolverine