我用在IBAction爲(按下按鈕)方法的代碼:只有在UIButton動畫完成後才更新標籤?
CABasicAnimation *rotateButton; //don't forget to release
rotateButton = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
rotateButton.fromValue = [NSNumber numberWithFloat:0];
rotateButton.toValue = [NSNumber numberWithFloat:((720*M_PI)/180)];
rotateButton.duration = 0.75;
rotateButton.repeatCount = 1;
[sender addAnimation:rotateButton forKey:@"720"];
,並有我想只更新後,這是完整的一個標籤。我想知道是否有一個簡單的例子,任何人都可以提供給我,讓標籤只在完成時更新,而不是在方法完成時更新。我知道你不能使用「@selector(animationDidStop:finished:context :)」,因爲蘋果不喜歡它。任何人的幫助?謝謝,麻煩您了!
我去了底部的代碼,因爲我希望它是4倍前。不幸的是,我對此感到陌生,並且在CGAffineTransformMakeRotation行中出現錯誤:「請求成員」轉換爲「不是結構或聯合的東西」....對於像我這樣的白癡有什麼想法? – BFBC 2011-04-17 00:30:23
Scratch ....我拼寫錯誤... – BFBC 2011-04-17 03:33:17
btw ..我唯一可以讓@selector工作在多個按鈕上並正確使用setAnimationDidStop @選擇器的方法是使用[UIView setAnimationDelegate:self]行[UIView commit動畫] – BFBC 2011-04-17 05:16:35