奇怪的导航控制器行为与不同的标签栏堆栈

时间:2021-08-25 17:27:37

I have a tab bar controller with a nav bar embedded in each tab as root. I am using a detail view controller that will be accessed from 2 of these tab bar stacks. When accessing this view controller in it's own stack, everything works as expected. However, if the user is in the other tab and segues to this detail view controller, the view slips behind the navigation bar. Its like the nav bar isn't even there, it just goes underneath it. I've been scratching my head trying to figure out what's going on, any insights would be greatly appreciated!

我有一个标签栏控制器,每个标签中都有一个导航栏作为root。我正在使用一个详细视图控制器,可以从其中两个标签栏堆栈中访问。在它自己的堆栈中访问此视图控制器时,一切都按预期工作。但是,如果用户位于其他选项卡中并且已切换到此详细视图控制器,则视图将滑动到导航栏后面。就像导航栏甚至不在那里,它只是在它下面。我一直在试图弄清楚发生了什么,任何见解都会非常感激!

1 个解决方案

#1


0  

Figured it out for those in a similar predicament. Need to add navigationController?.navigationBar.translucent = false in viewDidLoad. In iOS 7 this changed, by adding this line it won't slide the view beneath the nav bar.

找出那些处于类似困境的人。需要在viewDidLoad中添加navigationController?.navigationBar.translucent = false。在iOS 7中,通过添加此行,它不会在导航栏下滑动视图。

#1


0  

Figured it out for those in a similar predicament. Need to add navigationController?.navigationBar.translucent = false in viewDidLoad. In iOS 7 this changed, by adding this line it won't slide the view beneath the nav bar.

找出那些处于类似困境的人。需要在viewDidLoad中添加navigationController?.navigationBar.translucent = false。在iOS 7中,通过添加此行,它不会在导航栏下滑动视图。