4
我想在UILabel文本上應用動畫。我編寫代碼來增加動畫塊中的字體大小,但不應用動畫。動畫UILabel文本大小增加和減少
[UIView beginAnimations:nil context:nil/*contextPoint*/];
monthsOnBoard.font=[UIFont fontWithName:@"digital-7" size:150];
daysOnBoard.font=[UIFont fontWithName:@"digital-7" size:150];
hoursOnBoard.font=[UIFont fontWithName:@"digital-7" size:100];
minutesOnBoard.font=[UIFont fontWithName:@"digital-7" size:100];
secondsOnBoard.font=[UIFont fontWithName:@"digital-7" size:100];
[UIView setAnimationDelegate:self];
[UIView setAnimationDelay:0.5];
[UIView setAnimationDuration:1];
[UIView setAnimationRepeatCount:4];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView commitAnimations];
一件事是,monthsOnBoard.transform = CGAffineTransformMakeScale(2.0,2.0);應該在[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];之後; –
那麼我通常會看到的是在beginAnimations方法之後立即設置每個動畫屬性(如setAnimationCurve),然後列出要進行動畫處理的更改並使用[UIView commitAnimations]。但是,我不認爲它有什麼區別,提交動畫之前的順序方法應該不重要。說實話,我從來不再使用這種動畫方式。你應該尋找阻止動畫(他們開始像[UIView animateWithDuration:....],也試試看! –