动画结束时如何隐藏视图?

时间:2011-09-06 01:28:20

标签: ios4 iphone-sdk-3.0 core-animation cocos2d-iphone

我正在使用效果很好的curlup和curldown动画。我的问题是我的视图在推送viewcontroller之前仍然存在一秒钟。动画结束时如何隐藏当前视图?

2 个答案:

答案 0 :(得分:3)

希望这段代码能帮到你......

一旦检查.......

当你的动画在那时完成“customView”框架大小设置(x,y,0,0)....如下所示

-(void)close_but{   
CGRect viewTopFrame = CGRectMake(150,240,0,0);
[UIView animateWithDuration:0.5
            delay:0
            options: UIViewAnimationCurveEaseOut
             animations:^{
                 "customView".frame = viewTopFrame;

                     } 
                     completion:^(BOOL finished){
                         NSLog(@"Done!");
                     }];
customView.frame=viewTopFrame;

答案 1 :(得分:0)

一旦动画完成,您可以将视图的alpha设置为0,如:

[customView setAlpha:0];
相关问题