【发布时间】:2020-09-26 06:25:05
【问题描述】:
按照教程以编程方式制作没有 pod 的侧边菜单后,我遇到了关于导航的问题。我将登录视图设置为根视图控制器,登录后我将看到主视图。当这种转换发生时,应该出现在侧边菜单的导航栏不会出现,因此我无法访问我的侧边菜单。我知道我的侧边菜单有效,因为当我将主视图设置为根控件时,显示栏允许我单击侧边菜单。
场景代理:
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()
我在登录控制器中使用的转换:
let homeView = HomeMenu()
homeView.modalTransitionStyle = .flipHorizontal
homeView.modalPresentationStyle = .overCurrentContext
present(homeView, animated: true, completion: nil)
- 我不想使用 pod
- 我正在使用 Firebase
- 我也有注册
- 当我离开主菜单然后返回时,我仍然希望栏出现。
【问题讨论】:
标签: ios swift xcode uinavigationcontroller uinavigationbar