我有一个应用程序,在将选项卡栏 Controller 添加到窗口之前,我需要有一个登录或注册系统,例如在 Instagram 中。
我已将 5 个导航 Controller (以 View Controller 作为其根)添加到 UITabBarController
,然后将其设置为窗口的根。在此之前,我需要为登录系统准备另一个 UINavigationController
。
如果我添加它,如何在添加选项卡之前删除它?
另一个问题是我还必须处理注销,所以我需要回来处理它。
谁能帮我解决这个问题?
最佳答案
我建议您像往常一样从代理窗口加载登录 View 。从 Logged Success 的按钮单击您设置 TabbarController
如下:-
UIViewController *viewControllerPostalCode2 = [[cntrServices alloc] initWithNibName:@"cntrServices" bundle:nil];
UIViewController *viewControllerPostalCode3 = [[cntrInquiryViewController alloc] initWithNibName:@"cntrInquiryViewController" bundle:nil];
UINavigationController *navPostage1 = [[UINavigationController alloc] initWithRootViewController:viewControllerPostalCode2];
UINavigationController *navPostage2 = [[UINavigationController alloc] initWithRootViewController:viewControllerPostalCode3];
//
navPostage1.navigationBar.tintColor =DARK_BACKGROUNDNavigation;
navPostage2.navigationBar.tintColor =DARK_BACKGROUNDNavigation;
//
self.tabBarForServicesController = [[UITabBarController alloc] init];
self.tabBarForServicesController.delegate=self;
self.tabBarForServicesController.viewControllers = [NSArray arrayWithObjects:navPostage1,navPostage2,nil];
[self.navigationController pushViewController:self.tabBarForServicesController animated:YES];
我使用这种方法完成了这种类型的任务,在注销时 poptoRootviewController 回到登录屏幕。
关于ios - 如何在添加 UITabBarController 之前显示导航 Controller (一组 View Controller ),例如登录或注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20992859/