所以,我已经搜索了很多这个,似乎无法找到解决方案。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