简体   繁体   English

我应该使用哪个序列垂直显示视图控制器?

[英]Which segue should I use to show a view controller vertically?

First and foremost i'm still new to Swift so please bear with me. 首先,我还是Swift的新手,所以请多多包涵。 Say i'm at view controller A (which is the root view controller in the navigation hierarchy) and I want view controller B to appear as a popup (cover the entire screen). 假设我在视图控制器A(这是导航层次结构中的根视图控制器)上,并且我希望视图控制器B出现为弹出窗口(覆盖整个屏幕)。 I want that popup and to remain part of the navigation hierarchy. 我希望该弹出窗口并保留在导航层次结构中。 Then from that popup push to view controller C with a horizontal transition. 然后从该弹出窗口中推送到具有水平过渡的视图控制器C。 How would I do this? 我该怎么做? I am using segues. 我正在使用segues。 I just don't know which segue to use. 我只是不知道该使用哪个序列。 Should I use a modal or popover segue to go from view controller A to view controller B? 我应该使用模态或弹出窗口搜索从视图控制器A转到视图控制器B吗? Or should I simply use a push segue and use a custom transition? 还是我应该简单地使用推送搜索并使用自定义过渡? I'd prefer not to use a custom transition but let me know what you think. 我不希望使用自定义过渡,但请告诉我您的想法。

将ViewController B嵌入到导航控制器中,然后模态显示导航控制器。

Use the below code to present the VC from bottom. 使用下面的代码从底部显示VC。

let alertVC = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomAlertViewController") as! CustomAlertViewController

alertVC.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext

self.present(alertVC, animated: true, completion: nil)

Then further use push for other VC's 然后进一步将push用于其他VC

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

相关问题 我应该使用哪个视图控制器? - Which view controller should I use? 如何管理应该在父视图控制器中显示哪个控制器? - how to manage which controller should show in parent view controller? 如果我使用 IOS 图形 Segue 而不是在视图控制器中执行会怎样? - What if I use IOS graphical Segue instead of doing it in the view controller? 如果我执行放宽顺序(显示),则母亲视图控制器如何获得孩子的视图控制器? - If I perform an unwind segue (show), how can the mother view controller get the child's view controller? 如何在子视图控制器中显示转场? - How to show a segue inside a child view controller? Xcode - 从模态视图控制器显示转场 - Xcode - Show segue from modal view controller 如何创建Segue或新视图控制器以显示在其他视图控制器上 - How to create segue or new view controller to show on different view controller 如何使用导航控制器设置(包括后退设置)显示视图控制器(快速) - How to show a view controller using a navigation controller segue, including back segue (Swift) 如何使用日期(从日期选择器中选择)来选择特定的View Controller? - How do I use a date (selected from a date picker) to allow me to segue to a specific View Controller? 如何在 Xcode 11.1 中创建使视图 controller 全屏显示的 Segue - How to create Segue which make view controller fullscreen in Xcode 11.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM