popViewControllerAnimated动画在iOS5中不起作用

时间:2012-01-14 09:44:10

标签: iphone sdk uinavigationcontroller ios5 poptoviewcontroller

尝试回到之前的viewController,但iOS5中的动画无效。

- (IBAction)backToPreviousController
{
    [self.navigationController popViewControllerAnimated:YES];
}

有人能帮助我吗?

1 个答案:

答案 0 :(得分:2)

从OP,Davey Jones

手动添加动画解决了问题

CATransition *transition = [CATransition animation]; 
transition.duration = 0.5; 
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 
transition.type = kCATransitionPush; 
transition.subtype = kCATransitionFromLeft; 
[self.navigationController.view.layer addAnimation:transition forKey:nil];