<tfoot id='OLAmn'></tfoot>

    <bdo id='OLAmn'></bdo><ul id='OLAmn'></ul>

<i id='OLAmn'><tr id='OLAmn'><dt id='OLAmn'><q id='OLAmn'><span id='OLAmn'><b id='OLAmn'><form id='OLAmn'><ins id='OLAmn'></ins><ul id='OLAmn'></ul><sub id='OLAmn'></sub></form><legend id='OLAmn'></legend><bdo id='OLAmn'><pre id='OLAmn'><center id='OLAmn'></center></pre></bdo></b><th id='OLAmn'></th></span></q></dt></tr></i><div id='OLAmn'><tfoot id='OLAmn'></tfoot><dl id='OLAmn'><fieldset id='OLAmn'></fieldset></dl></div>

  1. <small id='OLAmn'></small><noframes id='OLAmn'>

    1. <legend id='OLAmn'><style id='OLAmn'><dir id='OLAmn'><q id='OLAmn'></q></dir></style></legend>

    2. 以编程方式创建一个 navigationController (Swift)

      时间:2023-05-17
        <tfoot id='UbxeH'></tfoot>

            <legend id='UbxeH'><style id='UbxeH'><dir id='UbxeH'><q id='UbxeH'></q></dir></style></legend>

                <tbody id='UbxeH'></tbody>

              <small id='UbxeH'></small><noframes id='UbxeH'>

            1. <i id='UbxeH'><tr id='UbxeH'><dt id='UbxeH'><q id='UbxeH'><span id='UbxeH'><b id='UbxeH'><form id='UbxeH'><ins id='UbxeH'></ins><ul id='UbxeH'></ul><sub id='UbxeH'></sub></form><legend id='UbxeH'></legend><bdo id='UbxeH'><pre id='UbxeH'><center id='UbxeH'></center></pre></bdo></b><th id='UbxeH'></th></span></q></dt></tr></i><div id='UbxeH'><tfoot id='UbxeH'></tfoot><dl id='UbxeH'><fieldset id='UbxeH'></fieldset></dl></div>
                <bdo id='UbxeH'></bdo><ul id='UbxeH'></ul>
              • 本文介绍了以编程方式创建一个 navigationController (Swift)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我一直在尝试以编程方式重做我的应用程序上的工作.(不使用情节提要)

                I've been trying to redo the work on my app programmatically. (Without the use of storyboards)

                我差不多完成了,除了手动制作导航控制器.

                I'm almost done, except making the navigation controller manually.

                我一直在做一些研究,但找不到任何手动实现此功能的文档.(我开始将应用程序制作为单视图应用程序)

                I've been doing some research but I can't find any documentation of implementing this manually. (I started making the app as a Single View Application)

                目前,我只有 1 个视图控制器.当然还有 appDelegate

                Currently, I only have 1 viewcontroller. And of course the appDelegate

                导航控制器将在应用程序的所有页面中使用.

                The navigation Controller, will be used throughout all pages in the application.

                如果有人可以帮助我,或者发送指向一些适当文档的链接以便以编程方式执行此操作,我们将不胜感激.

                If anyone could help me out, or send a link to some proper documentation for doing this programmatically it would be greatly appreciated.

                我忘了提到它是在 Swift 中的.

                I forgot to mention it's in Swift.

                推荐答案

                Swift 1, 2:

                func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
                   self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
                   var nav1 = UINavigationController()
                   var mainView = ViewController(nibName: nil, bundle: nil) //ViewController = Name of your controller
                   nav1.viewControllers = [mainView]
                   self.window!.rootViewController = nav1
                   self.window?.makeKeyAndVisible()
                }
                

                Swift 4+:和 Swift 5+

                func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
                   self.window = UIWindow(frame: UIScreen.main.bounds)
                   let nav1 = UINavigationController()
                   let mainView = ViewController(nibName: nil, bundle: nil) //ViewController = Name of your controller
                   nav1.viewControllers = [mainView]
                   self.window!.rootViewController = nav1
                   self.window?.makeKeyAndVisible()
                }
                

                这篇关于以编程方式创建一个 navigationController (Swift)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在 UINavigationBar 上设置后退按钮的文本? 下一篇:警告的含义“在演示过程中!"

                相关文章

                <i id='UF3iz'><tr id='UF3iz'><dt id='UF3iz'><q id='UF3iz'><span id='UF3iz'><b id='UF3iz'><form id='UF3iz'><ins id='UF3iz'></ins><ul id='UF3iz'></ul><sub id='UF3iz'></sub></form><legend id='UF3iz'></legend><bdo id='UF3iz'><pre id='UF3iz'><center id='UF3iz'></center></pre></bdo></b><th id='UF3iz'></th></span></q></dt></tr></i><div id='UF3iz'><tfoot id='UF3iz'></tfoot><dl id='UF3iz'><fieldset id='UF3iz'></fieldset></dl></div>
              • <tfoot id='UF3iz'></tfoot>

              • <legend id='UF3iz'><style id='UF3iz'><dir id='UF3iz'><q id='UF3iz'></q></dir></style></legend>

                1. <small id='UF3iz'></small><noframes id='UF3iz'>

                    • <bdo id='UF3iz'></bdo><ul id='UF3iz'></ul>