IOS从标签栏项目执行segue [英] IOS perform segue from tab bar item

查看:87
本文介绍了IOS从标签栏项目执行segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有2个项目的Tab栏控制器。第一项是包含表视图的VC。单击一个单元格,执行一个segue到其他视图控制器(不是标签栏控制器上的项目)。

I have a Tab bar controller with 2 items. The first item is a VC which contains a table view. Clicking on a cell, performs a segue to some other view controller (not an item on the tab bar controller).

问题是它在segue时删除了标签栏完成。
如何将项目1替换为其他VC并仍然将标签栏保留在底部?

The problem is that it removes the tab bar when segue completes. How can I just replace the item 1 with other VC and still keep the tab bar in the bottom?

推荐答案

你需要嵌入你的 Item1VC NavigationController 这样当你从 ItemVC 推送到 MoviesViewController 它不会删除标签栏,如果你没有嵌入 NavigationController 那么它将从主<$ c推出$ c> ViewController 在你的情况下它是 TabbarController ,这样你就看不到tabbar了。

You need to embed your Item1VC to NavigationController so that when you push from ItemVCto MoviesViewController it will not remove the tabbar, if you doesn't embed the NavigationController then it will push from the main ViewControllerin your case it is TabbarController so that you are not able to see the tabbar.

这篇关于IOS从标签栏项目执行segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆