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