首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >NavigationController PushedView控制器以编程方式关闭整个NavigationController - swift

NavigationController PushedView控制器以编程方式关闭整个NavigationController - swift
EN

Stack Overflow用户
提问于 2020-09-29 08:19:33
回答 1查看 29关注 0票数 0

我以这样的方式呈现了一个NavigationController:

代码语言:javascript
运行
复制
let profileViewController = ProfileViewController(nibName: nil, bundle: nil)
        let navigationControllerProfile = UINavigationController(rootViewController: profileViewController)
        navigationControllerProfile.setNavigationBarHidden(true, animated: false)
        navigationControllerProfile.modalPresentationStyle = .fullScreen
        self.present(navigationControllerProfile, animated: true, completion: nil)

每当我从这个NavigationController推送Viewcontroller时:

代码语言:javascript
运行
复制
let showCaseViewController = ShowcaseViewController()
        showCaseViewController.modalPresentationStyle = .overFullScreen
        self.navigationController?.pushViewController(showCaseViewController, animated: true)

ViewController被正确推送,但在1秒后整个NavigationController被清除。

EN

Stack Overflow用户

发布于 2020-09-29 15:37:33

用于显示带有导航的视图控制器的代码

代码语言:javascript
运行
复制
                let vc = storyboard?.instantiateViewController(withIdentifier: "firstvc") as! firstvc
                let navigation = UINavigationController(rootViewController: vc)
                vc.modalPresentationStyle = .fullScreen
                self.present(navigation, animated: true, completion: nil)

用于在呈现的视图控制器内执行推送操作的代码

代码语言:javascript
运行
复制
            let vc = storyboard?.instantiateViewController(withIdentifier: "email") as! email
            self.navigationController?.pushViewController(vc!, animated: true)
票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64111236

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档