CurlTransition like Maps

Discussion in 'iPhone/iPad Programming' started by kikko088, May 22, 2011.

  1. macrumors member

    Joined:
    Oct 13, 2010
    Location:
    Italy
    #1
    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:

    Code:
    - (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.

    [​IMG]

    Uploaded with ImageShack.us

    where is the mistake?
    thank you!

    kikko088
     
  2. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    No need to make CATransitions etc. it's in the standard ModalView animations.

    Code:
     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 -->

    Code:
     [self dismissModalViewControllerAnimated:NO]; 
    Easy as that
     
  3. thread starter macrumors member

    Joined:
    Oct 13, 2010
    Location:
    Italy
    #3
    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...

    [​IMG]


    kikko088
     

Share This Page