我有一个UIPageViewController
包含5个的风俗UIViewControllers
,现在我想从这5个中导航UIViewController
,但是我不能,因为这些UIViewControllers
没有UINavigationController
。谁能建议我,我该如何从那5个导航UIViewControllers
到另一个UIViewController
?
您的-中的代码[AppDelegate application:didFinishLaunchingWithOptions:]
可能如下所示(在检查了您的跳过条件之后):
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc1 = [storyboard instantiateViewControllerWithIdentifier:@"MyAuth"]; //if you assigned this ID is storyboard
UIViewController *vc2 = [storyboard instantiateViewControllerWithIdentifier:@"Login"]; //if you assigned this ID is storyboard
UIViewController *vc3 = [storyboard instantiateViewControllerWithIdentifier:@"Details"];
NSArray *controllers = @[vc1, vc2, vc3];
UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
[navController setViewControllers:controllers];
如果仅[AppDelegate application:didFinishLaunchingWithOptions:]
将其粘贴到- ,则会立即看到它的作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句