ios - 在 UITabBarController 内部,如何从一个 View Controller 切换到另一个 View Controller 并保留选项卡栏?

标签 ios swift3 uitabbarcontroller uigesturerecognizer

我将 UITabBarController 从对象库拖到 Storyboard。 我想使用滑动手势识别器从firstViewController滑动到另一个名为CustomController的viewController,并在实例化时保留CustomController上的选项卡栏。
问题是,一旦从firstViewController执行segue到CustomController,标签栏就不再显示在Custom Controller的底部,并且不会滑回到firstViewController。

这就是我想要达到的结果。请告知最佳路线。

enter image description here

最佳答案

You can use ContainerView to view your view controller. when you click on segment 1 you can set your firstviewcontroller to containerview and when you click on segment 2 you need to replace customviewcontroller in containerview. you do like this you will not lose your tab bar viewcontroller. For Swipe gesture, you can add it later if you want. Hope this can help you.

关于ios - 在 UITabBarController 内部,如何从一个 View Controller 切换到另一个 View Controller 并保留选项卡栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44755603/

相关文章:

objective-c - '==' 的左操作数是垃圾值

ios - IAP 非续订订阅恢复

swift - TabBar 控制导航栏

uiview - IOS 7 隐藏标签栏问题

ios - 显示边界外的图像 - iOS/Swift

ios - 将矩阵转换为 CGAffineTransform

ios - 无法使用自定义 DelegateProxy 和协议(protocol)接收事件

swift3 - 无法覆盖在 BEMSimpleLineGraph 中标记为不可用的 method_name

java - 如何导入 Java 库并在我的 IOS(Swift) 项目 Xcode 9 中使用它

iOS标签栏 Controller 在 Controller 顶部添加导航按钮