Objective c 动画完成后,如何隐藏UIImageView?
动画完成后,如何隐藏UIImageView?当我进入视图时,我的动画工作正常。我想成为一个能够隐藏动画完成后的图像。我该怎么做Objective c 动画完成后,如何隐藏UIImageView?,objective-c,uiimageview,segue,uianimation,Objective C,Uiimageview,Segue,Uianimation,动画完成后,如何隐藏UIImageView?当我进入视图时,我的动画工作正常。我想成为一个能够隐藏动画完成后的图像。我该怎么做 -(void) animate { NSLog(@"Animate"); CGPoint startPoint = [pickerCircle center]; CGPoint endPoint = [pickerButton1 center]; CGMutablePathRef thePath = CGPathCreateMutab
-(void) animate
{
NSLog(@"Animate");
CGPoint startPoint = [pickerCircle center];
CGPoint endPoint = [pickerButton1 center];
CGMutablePathRef thePath = CGPathCreateMutable();
CGPathMoveToPoint(thePath, NULL, startPoint.x, startPoint.y);
CGPathAddLineToPoint(thePath, NULL, endPoint.x, endPoint.y);
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.duration = 3.f;
animation.path = thePath;
animation.repeatCount = 2;
animation.removedOnCompletion = YES;
[pickerCircle.layer addAnimation:animation forKey:@"position"];
pickerCircle.layer.position = endPoint;
}
你试过完成吗?下面是一个关于使用completion显示和隐藏视图的示例。
我对动画不太了解,但我认为完成应该有效。将动画的“委托”属性设置为“自相似”:
animation.delegate = self;
然后您可以使用:
-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
// hide your UIImage here
}
动画完成后将调用它。抱歉,这并不能真正回答我的问题。是的,我在其他类型的动画中看到了使用“完成:块”的示例,我正在专门寻找有关CAKeyframeAnimation的帮助