开发者

troubles with animation

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜