Animation Issues

I have a little problem, I have a webcontrol viewcontroller and some button, I want to apply curl animation to webview and see instad webview view if the same controller.

like this

enter image description here

instead of this

enter image description here

in the first case, I use webview.hidden = YES, but when I try to return to the (obviusly) hidde view, if I put webview.hidden = NO in the method to return, I get this

enter image description here

any solution?

this is my 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.7;

    [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.7;
    animation.endProgress = 0;

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

All Articles