6
我有一个标签,我想淡入然后淡出。 这里是我的代码:淡入,淡出动画到uilabel
-(void) fadein
{
scoreLabel.alpha = 0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:2];
scoreLabel.alpha = 1;
[UIView commitAnimations];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
}
-(void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
scoreLabel.alpha = 0;
[UIView commitAnimations];
}
从这个代码我得到这样的情况:我的标签是淡入,然后我看不出淡出动画。 我该如何解决它?
谢谢!我忘了使用setAnimationDelagate,现在它完美地工作! – user1492776 2012-07-06 07:32:06
欢迎..如果它工作,然后upvote并接受答案:) – mayuur 2012-07-06 07:36:13