iBook page flip transition
Asked Answered
L

2

3

I'm trying recreate iBook like transition for pages in landscape mode for an pdf reader app. I only need the animation, not the, touch handling like iBook app; the user with a simple swipe turn the page. I have tried different sample code, including Leaves, but I can't find anything simple. Can Anyone help me to create this simple animation, or there's a simple way to recreate iBook transition?

Lozar answered 27/4, 2011 at 13:37 Comment(4)
Leaves is an excellent project that is easy and simple to include in projects.Clerk
There's a way to modify Leaves to only do the transition between pages without tracking touches?Lozar
Leaves also support landscape orientation with two pages?Lozar
there are different forks of Leaves which include landscape with 2 pages: github.com/ansani/leavesClerk
C
4

Ole Begemann has done something like this. You can find the project here on GitHub.

Ole also writes a superb blog summary of some of the best developer links and tutorials around. Well worth subscribing to!

Crosscheck answered 27/4, 2011 at 13:42 Comment(2)
I don't want to use the Leaves framework because I only need the animation, I don't need to track the touch of the user. I only need the animation of the flipping page.Lozar
It shouldn't be too hard to use it without the touch tracking. You could remove that part of the code and replace it with an animation curve.Crosscheck
G
0

Look at the UIView documentation for animation types available. Here is what I'd use:

UIViewAnimationOptions animation;
if (pageNumberLower) {
    animation = UIViewAnimationOptionTransitionCurlDown;
} else {
    animation = UIViewAnimationOptionTransitionCurlUp;
}

[UIView transitionWithView:myChangingView
                  duration:0.5
                   options:animation
                animations:^{ CHANGE PAGE HERE }
                completion:NULL];
Guava answered 27/4, 2011 at 13:44 Comment(1)
This certainly looks nice, but is nothing compared to the iBook page flip animation.Midgett

© 2022 - 2024 — McMap. All rights reserved.