简体   繁体   English

选择到TabbarController

[英]segue to the TabbarController

In my image, my first Tabbar is HomeViewController and the second Tabbar is CameraViewController. 在我的图像中,我的第一个Tabbar是HomeViewController,第二个Tabbar是CameraViewController。 What is the proper way to segue to the Tabbarcontroller? 锁定到Tabbarcontroller的正确方法是什么? You can see the read line, I try to segue this but I always get the back button in my HomeViewController and It display weird like not showing the navigation name. 您可以看到读取的行,我试图找出来,但是我总是在HomeViewController中得到后退按钮,并且它显示奇怪,就像不显示导航名称一样。 In CameraViewController I hide the Tabbar for the use camera button. 在CameraViewController中,我隐藏了使用相机按钮的标签栏。 I try to use segue programmatically like this one. 我尝试以编程方式像这样使用segue。

[self performSegueWithIdentifier:@"sample" sender:sender]

but It doesn't work properly. 但是它不能正常工作。 Is this possible to segue to TabbarController? 可以锁定到TabbarController吗? 在此处输入图片说明

You can't call 你不能打电话

[self performSegueWithIdentifier:@"sample" sender:sender]

Because you're in TabBarController already. 因为您已经在TabBarController中。 You could implement custom flow. 您可以实现自定义流程。 By pressing "Back" button - just show TabBar and change selected tabBarItem for example… 通过按“返回”按钮-仅显示TabBar并更改选定的tabBarItem例如……

update used this 更新使用了这个

[self.tabBarController setSelectedIndex:0];

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM