How to animate removeFromSuperview

后端 未结 1 1545
失恋的感觉
失恋的感觉 2021-02-07 13:21

I animated the appearance of my subview with:

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


        
相关标签:
1条回答
  • 2021-02-07 13:56

    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)
提交回复
热议问题