0

我正在用 setViewControllers 方法替换导航控制器内的视图。但我不喜欢过渡的样子。使用以下代码时如何设置动画样式?

UIViewController *newVC = [self.storyboard instantiateViewControllerWithIdentifier:@"SuccessScreen"];
    NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:[[self navigationController] viewControllers]];
    [viewControllers removeLastObject];
    [viewControllers addObject:newVC];
    [[self navigationController] setViewControllers:viewControllers animated:YES];
4

1 回答 1

0

就像是

CATransition *yourAnimation=...;
[self.navigationController.view.layer addAnimation:yourAnimation forKey:nil]
[[self navigationController] setViewControllers:viewControllers animated:NO];
于 2012-12-17T15:43:11.650 回答