PDA

View Full Version : CurlTransition like Maps




kikko088
May 22, 2011, 01:20 PM
HI at all, I have a little problem, I want to do a page with the effect of Maps like this

http://i.imgur.com/44Hq2.png

I have a page with view-uiwebview and some button.
My method are this:


- (IBAction)toggleView:(id)sender {

CATransition *animation = [CATransition animation];
[animation setDelegate:self.view];
[animation setDuration:0.7];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];

animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.58;

[animation setRemovedOnCompletion:NO];
[self.vistaWeb.layer addAnimation:animation forKey:@"pageCurlAnimation"];
}

- (IBAction) torna {

CATransition *animation = [CATransition animation];
[animation setDelegate:self.view];
[animation setDuration:0.7];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];

animation.type = @"pageCurl";
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.58;
animation.endProgress = 0;
[self.vistaWeb.layer addAnimation:animation forKey:@"pageCurlAnimation"];
}


the problem is that when the page was curled I want to see the view inside the uiwebview.

http://img541.imageshack.us/img541/4748/schermata20110522a20170.png (http://imageshack.us/photo/my-images/541/schermata20110522a20170.png/)

Uploaded with ImageShack.us (http://imageshack.us)

where is the mistake?
thank you!

kikko088



jnoxx
May 23, 2011, 01:48 AM
No need to make CATransitions etc. it's in the standard ModalView animations.


LoginViewController *modalLoginView = [[[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil] autorelease];
[modalLoginView setModalPresentationStyle:UIModalTransitionStylePartialCurl];

[self.tabBarController presentModalViewController:modalLoginView animated:NO];

and if u pressed button on one of those buttons on second page -->

[self dismissModalViewControllerAnimated:NO];

Easy as that

kikko088
May 23, 2011, 04:44 AM
Hello, thank you for your answer but I have some question...
with this method I load on my view another controller while I want to apply the animation only to UIWebView, then see the view of the same controller...

http://img31.imageshack.us/img31/6114/schermatarh.png (http://imageshack.us/photo/my-images/31/schermatarh.png/)


kikko088