0

ここで何が起こっているのかわかりません。

別の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];

動いていない。しかし、私が行うと...(ビューにサブビューを追加)

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

forgotLoginViewController = [[ForgotLoginViewController alloc]initWithNibName:@"ForgotLoginViewController" bundle:Nil];
[self.view addSubview:forgotLoginViewController.view];

します?私のビューコントローラーとタブバーは、以下のように 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;

任意の提案をいただければ幸いです。

4

1 に答える 1

0

私はappDelegateのVCにナビゲーションコントローラーであるとは言わなかったばかです。すべてが機能しています!つまり、UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:viewController1];

于 2012-12-04T17:06:02.207 に答える