I am working on a storybook app, i want to do the page curl like in the following video.
Can anyone tell me how to do exactly like this.
Update:
I want this page curling to support iOS 4.3+. UIPageViewController will work only on iOS 6.
I am working on a storybook app, i want to do the page curl like in the following video.
Can anyone tell me how to do exactly like this.
Update:
I want this page curling to support iOS 4.3+. UIPageViewController will work only on iOS 6.
You might want to consider UIPageViewController
. It is quite useful in creating apps which use page curling animations. Here is the documentations link.
You can make use of the UIView's animation effect for this. I guess this should help you
[UIView beginAnimations:@"Curl" context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:contentView cache:YES];
[UIView commitAnimations];
where the contentView is the view where you are applying the animation. By varying the duration and animation curve you can modify your animation effect.
There are two ways of doing it:
The hard way, implement everything yourself (from scratch, with layers and masks and transforms and gradients) and a lot of headache.
the Easy way, read the documentation for UIPageViewController
as suggested by @Zen. Its very useful and gives you the exact animation that you want (as shown in video). Or, using some third party code.
If you dont't have time constraint, then I will say, go the first way. You will learn a lot.
Cheers, have fun :)
EDIT
Here is the link to a sample app:
https://www.dropbox.com/s/x4qo2igrzvnkj16/CurlAnimationProject.zip
check it and tell me what you think.
UISwipegestureRecognizer
and transforming contentView
etc. @Junkman you can have a look at it to get an idea of what you're going to do. For supporting iOS<5, you'll have to do the core-graphics thing yourself. –
Neckband transitionWithVeiw
and transform
are both available from iOS 4.0 –
Behka SettingViewController *svc = [[SettingViewController alloc]initWithNibName:@"SettingViewController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[self.navigationController pushViewController:svc animated:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
As mentioned several time in the answers the UIPageViewController (apple documentation) is the thing you should be looking at.
The implementation is fairly straightforward, the controller uses 2 delegates
It implements the swipe gesture for scrolling from page to page and can feature a page control at the bottom of your view.
For transitioning from page to page, you can either set a scroll animation (nice for photo / portfolios type) or the page curl you are looking for.
You can make page curl/flip effect by
For landscape mode:
[UIView beginAnimations:@"Curl" context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:contentView cache:YES];
[UIView commitAnimations];
For portrait mode:
[UIView beginAnimations:@"Curl" context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlLeft forView:contentView cache:YES];
[UIView commitAnimations];
© 2022 - 2024 — McMap. All rights reserved.