How to make half curl animation in iPhone like the maps app?
Asked Answered
F

3

6

I am using the following code for page curl animation

[UIView beginAnimations:@"yourAnim" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag];
...
[UIView commitAnimations];

Is it possible to make the half curl animation like the maps.app on iphone/ipod ?

Any ideas how to make an similar effect ?

Thanks

Formularize answered 19/5, 2010 at 5:22 Comment(0)
V
9

Apple does support this for the presentation of modal views as of 3.2. This makes sense: the page curl effect is intended to signal the user that a page of options or settings is being revealed, and when they are done changing things, they will be sent back to the original view. Apple doesn't want the animation to infer an ongoing change to the page hierarchy, just a modal one that must return to its starting place.

It's pretty straightforward to use; just be sure that you are starting from a full screen view, and loading with the UIModalPresentationFullScreen style, which I believe is the default.

There are animation transitions to use a similar effect in UIViews generally that were added as of 4.0, but this is a straightforward way to use the effect.

simpleVC * myModalVC = [[simpleVC alloc] init];
[myModalVC setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[myModalVC setDelegate:self];

[self presentModalViewController:myModalVC animated:YES];
[simpleVC release];

Link to Apple Docs on UIModalTransitionStyle constants

Vickey answered 20/4, 2011 at 16:32 Comment(0)
S
7

I too have been working on this issue and I settled in the short term on a PNG version of it placed within a button and using the curl to reveal animation. The only thing missing in my solution is the ability to interact (play) with the curling page the way you can in Maps.

The Method

First, I created a Page corner PNG in Photoshop based on a screenshot of Maps.

The Map Curl PNG

Page Curl PNG

The Map - Options Hidden

Map Curl - Map

The Map - Options Revealed

Map Curl - Options Reveal

Then, I added it to a UIButton that does a partial page curl transition.

Complete Source Code Available on GitHub

The complete working project is available at GitHub. Updated for iPhone 5.

Shir answered 5/7, 2012 at 10:14 Comment(0)
S
-1

Use the undocumented animation types mapCurl and mapUnCurl

Sailcloth answered 19/5, 2010 at 8:11 Comment(1)
i have tried it, but still not working. Its behaving like the fadein and fadeout effect both on the simulator and on the device.Formularize

© 2022 - 2024 — McMap. All rights reserved.