开发者

troubles with animation

开发者 https://www.devze.com 2023-03-07 14:22 出处:网络
I have a little problem, I have a viewcontroller with a webview and some button, I want to apply to webview a curl animation and see instad webview the view if the same controller.

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

like this

troubles with animation

instead this

troubles with animation

in the first case I use webview.hidden = YES but when I try to came back the view is (obviusly) hidde, if I put webview.hidden = NO on the method for come back I get this

troubles with animation

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 开发者_JS百科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"];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消