繁体   English   中英

从其他视图导航后,我的程序化侧边菜单的导航栏不会出现

[英]The navigation bar for my programmatic side menu won't appear after navigating from a different view

在遵循以编程方式制作没有 pod 的侧边菜单的教程后,我遇到了关于导航的问题。 我将登录视图设置为根视图 controller,登录后我将看到主视图。 当这种转换发生时,应该出现在侧边菜单的导航栏不会出现,因此我无法访问我的侧边菜单。 我知道我的侧边菜单有效,因为当我将主视图设置为根控件时,显示栏允许我单击侧边菜单。

场景委托:

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

    guard let windowScene = (scene as? UIWindowScene) else { return }

    window = UIWindow(frame: windowScene.coordinateSpace.bounds)
    window?.windowScene = windowScene
    let nav = UINavigationController()
    let mainView = LogInController()
    nav.viewControllers = [mainView]
    window?.rootViewController = nav
    window?.makeKeyAndVisible()  

我在 controller 的日志中使用的转换:

    let homeView = HomeMenu()
    homeView.modalTransitionStyle = .flipHorizontal
    homeView.modalPresentationStyle = .overCurrentContext
    present(homeView, animated: true, completion: nil)
  • 我不想使用 pod
  • 我正在使用 firebase
  • 我也有注册
  • 当我离开主菜单然后回来时,我仍然希望栏出现。

没关系,我只是以编程方式添加了一个导航栏,然后从那里添加了访问我的侧边菜单。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM