【发布时间】:2011-03-28 23:15:30
【问题描述】:
我希望在动画完成后移除此标签。在我的 touchesEnded 函数中的以下代码中制作动画时,我不想再看到它。我看不到检查 lbl.isAnimating 是否已经在 for 循环中忽略它的方法(没有创建我自己的 UILabels 列表),但我认为我的完成代码在这里会起作用。但是在动画结束后,如果我点击不可见的标签,我仍然会陷入 if point is inside block。
for( lbl in mLabelOutletCollection ) {
if (CGRectContainsPoint([lbl frame], [touch locationInView:self.view]))
{
[UIView animateWithDuration:1.0 delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction)
animations:^{
lbl.alpha = 0.0;
lbl.transform = CGAffineTransformMakeScale(1.5, 1.5);
}
completion:^(BOOL completed){
[lbl removeFromSuperview];
lbl.hidden=YES;
}
];
}
}
【问题讨论】:
标签: objective-c ipad animation uiview