ios - 如何在添加 UITabBarController 之前显示导航 Controller (一组 View Controller ),例如登录或注册

标签 ios iphone ipad uitabbarcontroller

我有一个应用程序,在将选项卡栏 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/

相关文章:

iphone - 如何在一个 View 中显示两个图像 - iphone

javascript - 在 HTML5 中检测 iPad Mini

iphone - PFQuery 排除特定列

jquery - 需要使用 JQtouch 帮助的 iPad 应用程序

ios - 关于 Swift 中复制的问题

ios - 无法使用参数传递 Timer.sheduledTimer

android - 如何减小自定义贴纸应用程序的文件大小

ios - 按钮之间的标签在哪里

ios - 在 iPhone iPhone 6 plus 中,全宽组件的左右两侧有边距

iphone - 在 iPhone 和 iPad 上使用动态创建的缩略图 ScrollView