动画的麻烦

时间:2011-05-23 10:29:56

标签: iphone xcode animation uiwebview

我有一点问题,我有一个带有webview和一些按钮的viewcontroller,我想在webview中应用一个curl动画,如果是同一个控制器,请查看instad webview视图。

像这样

enter image description here

而不是这个

enter image description here

在第一种情况下我使用webview.hidden = YES但是当我尝试回来时,视图是(obviusly)hidde,如果我把webview.hidden = NO放在方法上来回来我得到这个

enter image description here

任何解决方案?

这是我的代码:

- (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"];
}

0 个答案:

没有答案