所以,我已經搜索了很多這個,似乎無法找到解決方案。UIView動畫將不會運行轉換
此代碼:
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationDuration:5];
[c setCenter:CGPointMake(200, 200)];
[UIView commitAnimations];
此代碼不:
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:c cache:YES];
[UIView setAnimationDuration:5];
[c exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView commitAnimations];
我知道調用exchangeSubViewAtIndex工作,因爲如果我從動畫塊它起到預期中刪除。
任何人都有任何洞察力,爲什麼這個過渡不會運行?我需要導入的東西?
「context」參數供動畫回調(setAnimationDelegate/setAnimationWillStartSelector/setAnimationDidStopSelector)使用。你不需要它。將其設置爲NULL。 – 2010-06-11 20:23:13