AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
TabBarController *tabBarController = [[TabBarController alloc] init];
UIViewController *vc2 = [[SearchPageControllerViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:vc2];
NSArray *viewControllers = [NSArray arrayWithObjects:navController, vc2, nil];
[tabBarController setViewControllers:viewControllers];
}
我使用push segue连接,我有标签栏但是当我用push segue标签栏更改屏幕时获取invis如何解决这个问题我添加了这个代码部分但是现在有用吗?
检查图像以获取更多信息...
答案 0 :(得分:0)
确保您没有选中Storyboard上视图控制器的Attribute Inspector上的“在推送时隐藏底栏”选项。
答案 1 :(得分:-2)
为了避免在更改viewController时tabbar消失,我会使用presentViewController,而是使用dismissViewController。
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"testview"];
[self presentViewController:controller animated:YES completion:NULL];
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"rootVC"];
[self dismissViewController:controller animated:YES completion:NULL];