看起來,當您爲UIButton設置動畫時,真正的按鈕始終位於目標位置。動畫只是一部「電影」。 在此代碼中,在動畫中,只有當我觸摸空的最終目的地(以600x900爲中心)時,按鈕纔會獲取該事件。如果我在顯示位置看到它時觸摸它,這意味着在按鈕正在繪製的某個點(在動畫中間),它什麼也得不到。如何動畫(移動)一個UIButton,在移動過程中保持它可觸摸?
CGPoint point;
point.x = 600;
point.y = 900;
[UIView animateWithDuration:16
delay:0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionAllowAnimatedContent)
animations:^{
[movingbutton setCenter:point];
}
completion:^(BOOL finished){
NSLog(@"animation completed");
}
];
不知道如何使動畫按鈕在正確的動畫路徑中觸摸。任何想法? Thanx!
當然可以。什麼是賞金點? – Martha 2011-04-12 17:05:34