-1

我的 AppDelegate 中有 TabBarController :

IBOutlet TabBarViewController *tab;

这是我的应用程序中的主控制器。

在其中一个viewcontroller选项卡中,我想添加一个 UIButton,当用户按下它时,所有的 tabcontroller 将更改为另一个带有翻转动画的 uiviewcontroller。

我试图用这种方法来实现它:

RadioMainVC *radioMainVC = [[RadioMainVC alloc] initWithNibName:@"RadioMainVC" bundle:nil];
UINavigationController *radioNav = [[UINavigationController alloc] initWithRootViewController:radioMainVC];

[UIView beginAnimations:@"animation" context:nil];
[self.tabBarController presentModalViewController:radioNav animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.tabBarController.view cache:NO];
[UIView commitAnimations];

而且翻盘也打不开,有什么办法解决吗?

4

1 回答 1

1

不幸的是,我还没有测试过这段代码,但它可能会奏效:

[UIView transitionFromView: self.tabBarController.view
toView: radioNav.view
duration: 0.5
options: UIViewAnimationTransitionFlipFromLeft
completion: ^(BOOL finished) {
    window.rootViewController = radioNav;
}];
于 2013-05-21T08:23:38.680 回答