Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.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
Ios 使用UITabBar和NavigationController进行CAT转换_Ios_Uinavigationcontroller_Uitabbarcontroller_Core Graphics_Quartz Core - Fatal编程技术网

Ios 使用UITabBar和NavigationController进行CAT转换

Ios 使用UITabBar和NavigationController进行CAT转换,ios,uinavigationcontroller,uitabbarcontroller,core-graphics,quartz-core,Ios,Uinavigationcontroller,Uitabbarcontroller,Core Graphics,Quartz Core,不知道这里发生了什么 在显示另一个viewController的操作中执行此操作时: CATransition* transition = [CATransition animation]; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; transition.duration = 1.0f; transition.type = @"cube"

不知道这里发生了什么

在显示另一个viewController的操作中执行此操作时:

CATransition* transition = [CATransition animation];
transition.timingFunction = [CAMediaTimingFunction  functionWithName:kCAMediaTimingFunctionEaseIn];
transition.duration = 1.0f;
transition.type =  @"cube";
transition.subtype = @"fromRight";
[self.navigationController.view.layer removeAllAnimations];
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];

forgotLoginViewController = [[ForgotLoginViewController alloc]initWithNibName:@"ForgotLoginViewController" bundle:Nil];
[self.navigationController pushViewController:forgotLoginViewController animated:YES];
它不起作用。但是,当我执行…(将子视图添加到视图)

是吗?我的ViewController和tabbar在appdelegate中实现,如下所示

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

UINavigationController *navController = [[UINavigationController alloc]
                                         initWithRootViewController:viewController2];


self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, navController];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

return YES;

感谢您的建议。

我是个白痴,我没有在appDelegate中告诉VC作为导航控制器。现在都开始工作了!即UINavigationController*navController=[[UINavigationController alloc]initWithRootViewController:viewController1]

我是个白痴,我没有在appDelegate中告诉VC作为导航控制器。现在都开始工作了!即UINavigationController*navController2=[[uinavigationcontrolleralloc]initWithRootViewController:viewController1];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

UINavigationController *navController = [[UINavigationController alloc]
                                         initWithRootViewController:viewController2];


self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, navController];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

return YES;