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