简体   繁体   English

如何显示tabBar然后选择其他viewController并返回到此?

[英]How to show tabBar then segue to other viewController and return to this?

I have some viewControllers, I show the first viecontroller in tabBarController. 我有一些viewControllers,我在tabBarController中显示了第一个viecontroller。 Then I show other viewCOntroller from a button. 然后,我从一个按钮显示其他viewCOntroller。 The next viewController haven't tabBar, but if I want return to the first viewController in TabBar this not whow the tabBar. 下一个viewController还没有tabBar,但是如果我想返回TabBar中的第一个viewController,那不是tabBar了。

Can't I use this code: 我不能使用以下代码:

 myviewController *viewController = [[UIStoryboard storyboardWithName:@"Vista1" bundle:nil] instantiateViewControllerWithIdentifier:@"vist2"];
[self.navigationController pushViewController:viewController animated:NO];

How can I declare a instantiation of tabBar index 1 view? 如何声明tabBar索引1视图的实例化? How can I solve this and show the firstView how first time was showed? 如何解决此问题并显示firstView第一次显示的方式?

Thanks! 谢谢!

You can use this to return to the number one viewController for example. 例如,您可以使用它返回第一个viewController。

[self.tabBarController setSelectedIndex:0];

you can specify the desired index of the tabBar controller 您可以指定tabBar控制器的所需索引

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Segue无法从标签栏控制器中的ViewController运行 - Segue not working from the viewcontroller inside tabbar controller UINavigationController,如何在第二级viewController中隐藏选项卡,然后在第三级viewController中显示选项卡 - UINavigationController, how to hide tabbar in second level viewController then show tabbar in third level viewController 在ViewController循环中隐藏/显示TabBar - Hide/Show TabBar in ViewController loops 使用 Segue 返回到 TabBarController 的初始 ViewController 后,TabBar 被隐藏 - TabBar is hidden after going back to the initial ViewController of a TabBarController Using Segue 当segue到另一个ViewController时,TabBar嵌入式NavigationController栏会消失 - TabBar embedded NavigationController bar disappears when segue to another ViewController 如何正确选择到其他ViewController - How to segue to different ViewController properly 如何正确注销和segue到viewcontroller? - How to logout and segue to the viewcontroller correctly? 显示另一个ViewController的选项卡项的父ViewController - Show the parent ViewController of a tabbar Item from another ViewController 当按下时,Segue将不会显示ViewController - Segue won't show the ViewController when pressed Xcode 6中的“显示”segue将视图控件呈现为iOS 7中的模态 - 'Show' segue in Xcode 6 presents the viewcontroller as a modal in iOS 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM