Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.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
Ios uiimageview CABASICANIzation消失效应_Ios_Animation_Uiimageview_Effect_Cabasicanimation - Fatal编程技术网

Ios uiimageview CABASICANIzation消失效应

Ios uiimageview CABASICANIzation消失效应,ios,animation,uiimageview,effect,cabasicanimation,Ios,Animation,Uiimageview,Effect,Cabasicanimation,我希望图像越来越小,最后消失。我无法通过卡巴斯基化实现这一点。我应该用什么 CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"]; anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; anim.duration = 1

我希望图像越来越小,最后消失。我无法通过卡巴斯基化实现这一点。我应该用什么

CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"];
        anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        anim.duration = 1.0;
        anim.repeatCount = 1;
        anim.autoreverses = YES;
        anim.removedOnCompletion = YES;
        anim.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.01, 0.01, 1.0)];
        [_tile1.layer addAnimation:anim forKey:nil];
你可以试试这个

UIImageView *imgView;

[UIView animateWithDuration:0.5 animations:^{
    imgView.transform = CGAffineTransformScale(imgView.transform, 0.1, 0.1);
} completion:^(BOOL finished) {
    [imgView removeFromSuperview];
    imgView.image =nil;
    imgView = nil;
}];