I has a storyboard like below.
When i taped “Push ViewController 2”, a strange animation has appeared.
I set NavigationController.view.backgroundColor or TabBarController.view.background to white. But it does not working. I don’t want to set navigationBar.translucent to NO.
How can I get rid of it?
When you using a NavigationController in TabView application
. Its a common practice to embed a NavigationController separately to each of your ViewController to avoid unusual behaviour and also it gives you a better way to control your NavigationController
in seperate instance. Following Storyboard layout fix your strange animation.
Output:
PS: Same idea also mentioned by @skJosh comment.
Update:
Paste below code into your DetailViewController
to hide and unhide your TabBar.
override func viewWillAppear(_ animated: Bool) {
tabBarController?.tabBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
tabBarController?.tabBar.isHidden = false
}