tôi có một nhãn mà tôi muốn mờ dần và sau đó mờ dần. đây là mã của tôi:mờ dần, làm mờ hình động thành 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];
}
từ mã này tôi nhận được tình trạng này: nhãn của tôi là phai trong và sau đó tôi không nhìn thấy hình ảnh động fadeout. làm thế nào tôi có thể sửa chữa nó?
cảm ơn! tôi quên sử dụng setAnimationDelagate, bây giờ nó hoạt động hoàn hảo! – user1492776
welcome .. Nếu nó hoạt động thì upvote và chấp nhận câu trả lời :) – mayuur