uihostingcontroller

Hide UINavigationController's navigationBar when the root controller is a UIHostingController

别说谁变了你拦得住时间么 提交于 2021-02-08 09:10:13
问题 I am struggling to hide the navigationBar , which would properly be hidden if the root controller wasn't a SwiftUI UIHostingController . I tried the following: Setting navigationController.isNavigationBarHidden = true after creating it, at viewDidLoad and viewWillAppear . Adding both .navigationBarHidden(true) and .navigationBarBackButtonHidden(true) for the UIHostingController 's rootView . Could it be an Apple bug? I am using Xcode 11.6. All my attempts together: class LoginController:

Hide UINavigationController's navigationBar when the root controller is a UIHostingController

有些话、适合烂在心里 提交于 2021-02-08 09:09:05
问题 I am struggling to hide the navigationBar , which would properly be hidden if the root controller wasn't a SwiftUI UIHostingController . I tried the following: Setting navigationController.isNavigationBarHidden = true after creating it, at viewDidLoad and viewWillAppear . Adding both .navigationBarHidden(true) and .navigationBarBackButtonHidden(true) for the UIHostingController 's rootView . Could it be an Apple bug? I am using Xcode 11.6. All my attempts together: class LoginController: