我想用 pushViewController 动画 popViewController。有没有办法做到这一点?可能吗?
3 回答
有一个技巧你可以:)
获取要在弹出后可见的视图控制器。
pop 2x 没有动画
推送 targetviewcontroller 动画,你有控制器和推送动画:)
我希望它有帮助!
工作 100 %
list=[[List_ViewController alloc]initWithNibName:@"List_ViewControlleripad" bundle:nil]; CATransition *transition = [CATransition 动画]; 过渡时间= 0.45;transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; transition.type = kCATransitionFromLeft; [过渡集类型:kCATransitionMoveIn];transition.subtype = kCATransitionFromLeft; transition.delegate = self; [self.navigationController.view.layer addAnimation:transition forKey:nil]; self.navigationController.navigationBarHidden = 否;[self.navigationController pushViewController:list animated:NO];
[UIView beginAnimations:nil context:nil];
TargetViewCointroller *obj = [[TargetViewCointroller alloc]initWithNibName:@"TargetViewCointroller" bundle:nil];
[self.navigationController pushViewController:obj animated:YES];
[UIView setAnimationDuration:1.0];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[obj_ release];
让我知道它是否工作......快乐编码!!!!