swift - 将标签栏添加到所有屏幕,即使标签按钮不能立即访问该屏幕

标签 swift xcode uiviewcontroller uitabbar uitabbaritem

我的应用程序中有一个选项卡栏,其中有 3 个项目指向 3 个独立的 View Controller 。但是,在其中一个页面中,我有一个按钮转换到另一个 View Controller (单击该按钮,它会将您带到另一个页面),并且底部的选项卡不再可见。

想想 Instagram,您可以在其中搜索某个人...如果您单击该人的个人资料,底部的选项卡仍然可见且响应 swift ,而我的应用程序中的选项卡栏则不是。我需要 Instagram 在我的应用程序中具有相同的效果,但我对如何实现这一点感到困惑。

最佳答案

我创建了一个示例项目来解释我想要解释的内容

屏幕截图 - Storyboard

enter image description here

查看层次结构

---> Tab Controller
  ---> Tab Vc 1 --> ContentView With Navigation Controller
  ---> Tab Vc 2 --> ContentView With Navigation Controller
  ---> Tab Vc 3 --> ContentView With Navigation Controller
---> Demo Vc - Which wis the second ViewController to be displayed with in Tab Bar bounds

输出

enter image description here

项目链接

链接 - https://github.com/RockinGarg/ContainerView-TabBar.git

检查分支 - stack_Tab_VC_Container

克隆 - git clone -b stack_Tab_VC_Container https://github.com/RockinGarg/ContainerView-TabBar.git

关于swift - 将标签栏添加到所有屏幕,即使标签按钮不能立即访问该屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50766850/

相关文章:

ios - 导入 header 两次: duplicate symbol for architecture x86_64

ios - Swift 2.2 - 更新 UILabel 抛出 "unexpectedly found nil while unwrapping an optional value"

ios - 我可以在 Swift 闭包中使用多个分隔符拆分数字字符串吗?

ios - SceneKit 使用两个向量设置旋转

objective-c - Swift 开关不适用于基于 C++ 的枚举

ios - 使用 Storyboard时 UIView 委托(delegate)在什么阶段设置

ios - 如何允许标签栏项目有多个 View Controller

ios - 将多个参数传递给 addTarget

ios - 如何在iOS Swift中连接套接字?

objective-c - X代码 4.2 : How To Use Page-Based Application