How to animate removeFromSuperview

后端 未结 1 1855
悲&欢浪女
悲&欢浪女 2021-02-07 13:11

I animated the appearance of my subview with:

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionReve         


        
1条回答
  •  青春惊慌失措
    2021-02-07 13:57

    Well you could do the animation first and on the animationEndListener call removeFromSuperView

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

    0 讨论(0)
提交回复
热议问题