popViewController doesnt seem to work with UIView animations
I have the following code, which does a nice animation when pushing a new view controller.
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:0.5];
[[self navigationController] pushViewController:details animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
This code, using popViewController (rather than pushViewController) doesnt do the animation.
[UIView beginAnimations:@"animationback" context:nil];
[UIView setAnimationDuration:0.5];
[[self navigationController] popViewControllerAnimated:NO];
[UIView 开发者_Python百科setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
Any ideas why this would be and more importantly; how can I fix it?
Are you sure that self.navigationController.view
really refers to the right view ... the one being animated? I have the feeling that the first case works only by accident. Shouldn't you refer to the view of the controller being pushed / popped?
精彩评论