Xcode 11 UINavigationController Bar problems

喜夏-厌秋 提交于 2020-04-12 02:26:11

问题


Ever since Xcode 11 came out I have been trying to fix my app. There is something going on with the Status Bar + Navigation Bar and nothing I have been trying seems to be working and I can't seem to find any related issues either.

I have tried instantiating the Tab Bar Controller with less/more tabs. I tried changing the order. I tried using a navigation bar on the Tab Bar controller instead of the individual view controllers.

For some reason the first View Controller (root of a UINavigation Controller) in the Tab Bar Controller has no issues but when I change tabs, the navigation bar gets pushed up.

I added 2 screenshots to show what is going on. The first image shows the correct way the app is supposed to be and the second image shows the navigation bar being pushed into the status bar.

[UIView transitionFromView:self.window.rootViewController.view
                    toView:viewController.view
                  duration:0.55f
                   options: UIViewAnimationOptionTransitionCrossDissolve
                completion:^(BOOL finished){
                    self.window.rootViewController = viewController;

                }];

回答1:


I noticed a change with transitionFromView in IOS 13 thats different from IOS 12. To see if this is your issue, try setting self.window.rootViewController = viewController; without the transition code block, and see if you still have the problem.

self.window.rootViewController = viewController;
/*
[UIView transitionFromView:self.window.rootViewController.view
                    toView:viewController.view
                  duration:0.55f
                   options: UIViewAnimationOptionTransitionCrossDissolve
                completion:^(BOOL finished){
                    self.window.rootViewController = viewController;

                }];
*/


来源:https://stackoverflow.com/questions/58254034/xcode-11-uinavigationcontroller-bar-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!