I have added tab bar controller to my view controller, a white space is visible in the top of my view. I have tried to set my navigation bar visible to false in viewwillappear function, it didn't work. I have unchecked under bar in extended edges, that didn't work either. Someone please guide me through this problem.
My Storyboard https://i.stack.imgur.com/SxOYH.png
SceneDelegate.swift
guard let winScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: winScene)
let storyboard = UIStoryboard(name: "Home", bundle: nil)
let initialViewController = storyboard.instantiateViewController(identifier: "TabBarController")
let navController = UINavigationController(rootViewController: initialViewController)
window?.rootViewController = navController
window?.makeKeyAndVisible()
HomeVC.swift
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: true)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.