4

I am attempting to mimic the partial page curl animation that can be found in the Map app that comes on the iPhone. I am able to get it to partially curl, but the toolbar curls with the curling page, which I don't want. I merely want the toolbar at the bottom of the screen to stay where it is while the map view itself curls up.

I have a map view display in a navigation controller view. To me, it makes most sense if I load up this view from the root view controller, and I am able to successfully, however, the animation does not work as anticipated. Instead of having the page curl animation occur, the sliding of the view from the right occurs and the animation I have set takes place within buttons inside of the view. It is really very strange... I have even tried non-modal transition styles and get the same exact effect. Here is the relevant code:

-(IBAction)displayInfoButtonTapped {
    NSLog(@"ParkingRootViewController displayInfoButtonTapped");
    
    MapInfoView *mapInfoView = [[MapInfoView alloc] initWithNibName:@"MapInfoView" bundle:nil];
    
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:mapInfoView.view cache:YES];
    [UIView commitAnimations];  
    
    [self.navigationController pushViewController:mapInfoView animated:YES];
    [mapInfoView release];
    
    [mapView displayInfoButtonTapped];
    
}

Anyone have any idea of what I am doing wrong? Or does anyone have a better method of how to go about doing what I am trying to do? Thanks!

peterh
  • 11,875
  • 18
  • 85
  • 108
Stunner
  • 12,025
  • 12
  • 86
  • 145

2 Answers2

0

The curl animations that you get from UiView are always full screen. Too bad. For a different curl effect you have to get your hands dirty with OpenGL.

Kris Van Bael
  • 2,842
  • 1
  • 18
  • 19
0

I have this working but by having mutiple views and using the animation to remove the top view leaving the lower view in place. The Page Curl doesn't touch the toolbar. Here's my code for it.

[UIView beginAnimations:nil context:NULL];
[self.mapView removeFromSuperview];
[UIView setAnimationDuration:1.5];  
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView commitAnimations];

So my view controller has a MKMapView and a tableView, the map view is on top. When the user taps a button on the toolbar the above animation is played out with just the mapView being curled away.

Hope that makes sense.

simongking
  • 740
  • 5
  • 15