【发布时间】:2013-05-13 08:39:29
【问题描述】:
我希望 imageview 淡出然后完全隐藏。
这是我的代码
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration=1.0;
theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
theAnimation.toValue=[NSNumber numberWithFloat:0.0];
[flowerImageView.layer addAnimation:theAnimation forKey:@"animateOpacity"];
这工作正常,但是当值变为 0.0 时,图像视图不应再次出现
【问题讨论】:
-
淡出之后。您只需将其从超级视图(即 UIImageView)中删除。 [imageView removeFromSuperview].
-
但是我怎么知道值变成了0
标签: iphone uiimageview cabasicanimation