Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UITAB控制器翻转_Iphone_Ios_Objective C - Fatal编程技术网

Iphone UITAB控制器翻转

Iphone UITAB控制器翻转,iphone,ios,objective-c,Iphone,Ios,Objective C,我的AppDelegate中有TabBarController: IBOutlet TabBarViewController *tab; 这是我应用程序中的主控制器 在选项卡内的一个viewcontroller中,我想添加一个ui按钮,当用户按下它时,所有tabcontroller都将更改为另一个带有翻转动画的uiviewcontroller 我试着用这种方法来实现它: RadioMainVC *radioMainVC = [[RadioMainVC alloc] initWithNibNam

我的AppDelegate中有TabBarController:

IBOutlet TabBarViewController *tab;
这是我应用程序中的主控制器

在选项卡内的一个
viewcontroller
中,我想添加一个ui按钮,当用户按下它时,所有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];

翻转不起作用,知道如何修复吗?

不幸的是,我还没有测试这段代码,但它可能会起作用:

[UIView transitionFromView: self.tabBarController.view
toView: radioNav.view
duration: 0.5
options: UIViewAnimationTransitionFlipFromLeft
completion: ^(BOOL finished) {
    window.rootViewController = radioNav;
}];

pushViewController:animated:
是一种
UINavigationController
的方法,但是
self.tabbar控制器
可能是一个
UITabBarController
,所以这不能工作。为什么
会出现modalviewcontroller