ios - dismissview Controller 在 splitView 或 tabBar Controller 中不起作用

标签 ios swift uitabbarcontroller uisplitviewcontroller

描述: 我有一个 Spilled View Controller ,它有 masterController 来显示所有菜单项,辅助 Controller (DetailViewController1) 是显示一些细节。现在我有了 DetailViewController2,它显示了一些其他信息。

流程 SplitViewController,它有MasterViewController(菜单的表格 View )-> DetailViewController1 -> DetailViewController2

问题:如果我使用show segue 显示DetailViewController2 则没问题。如果我使用 show detail segue,则 DetailViewController2 中的导航栏后退按钮不会关闭我的 DetailViewController2 以返回到 DetailViewController1.

即使我使用 show segue,它也无法关闭。我在这里做错了什么?

最佳答案

你应该只使用 show,因为 Show detail segue 替换了 Controller 而不是推送它

来自苹果

显示详细信息:

Present the content in the detail area. If the app is displaying a master and detail view, the new content replaces the current detail. If the app is only displaying the master or the detail, the content replaces the top of the current view controller stack.

您可以在这里找到更多相关信息

https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/Chapters/StoryboardSegue.html

关于ios - dismissview Controller 在 splitView 或 tabBar Controller 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34392535/

相关文章:

即使在激活引导模式后,Swift UIAccessibilityIsGuidedAccessEnabled 也会返回 false

iphone - MPMoviePlayer setCurrentPlayBackTime 不工作

ios - 在 swift 类中使用 Objective-c 属性时的桥接问题

ios - swift : View's frame getting altered when a subview is added

ios - 如何在 iOS、Swift 中搜索 iBeacons UUID,并扫描周围的所有 iBeacons

ios - 如何从 View 获取数据到 UITabBarController

ios - 自动合成属性 'delegate' 将使用合成实例变量 '_delegate' ,而不是 MBProgressHUD.m 中现有的实例变量 'delegate'

iphone - 滑动手势有帮助吗?仅 LeftSwipe 有效,而 RightSwipe 无效

ios - 模态 segue 显示选项卡栏?

ios - 具有不同项目颜色的自定义 UITabBarController