Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何设置removeFromSuperview的动画_Objective C_Ios_Uiviewanimation_Catransition - Fatal编程技术网

Objective c 如何设置removeFromSuperview的动画

Objective c 如何设置removeFromSuperview的动画,objective-c,ios,uiviewanimation,catransition,Objective C,Ios,Uiviewanimation,Catransition,我使用以下设置子视图外观的动画: CATransition *transition = [CATransition animation]; transition.duration = 0.3; transition.type = kCATransitionReveal; [webView.layer addAnimation:transition forKey:nil]; [self.view addSubview:webView]; 但是现在我想删除我的子视图。如何添加动画来完成此操作?像

我使用以下设置子视图外观的动画:

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionReveal;
[webView.layer addAnimation:transition forKey:nil];

[self.view addSubview:webView];

但是现在我想删除我的子视图。如何添加动画来完成此操作?像其他的过渡?什么时候加这个?在添加子视图之前还是之后?

您可以先在
animationAndListener
调用
removeFromSuperView

[UIView animateWithDuration:0.5
    delay:1.0
    options: UIViewAnimationOptionCurveEaseOut
    animations:^{
        yourView.alpha = 0;
    }completion:^(BOOL finished){
        [yourView removeFromSuperview];
    }];

不确定这是否已更改,但现在的选项是:UIViewAnimationOptionCurveEaseOut