Xcode 11 UINavigationController 栏问题 [英] Xcode 11 UINavigationController Bar problems

查看:31
本文介绍了Xcode 11 UINavigationController 栏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从 Xcode 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.

我尝试使用更少/更多选项卡来实例化选项卡栏控制器.我尝试更改顺序.我尝试在 Tab Bar 控制器上使用导航栏而不是单个视图控制器.

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.

出于某种原因,标签栏控制器中的第一个视图控制器(UINavigation 控制器的根)没有问题,但是当我更改标签时,导航栏会向上推.

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.

我添加了 2 个屏幕截图来显示正在发生的事情.第一张图片显示了应用的正确方式,第二张图片显示了导航栏被推入状态栏.

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;

                }];

推荐答案

我注意到 IOS 13 中的 transitionFromView 与 IOS 12 不同.要查看这是否是您的问题,请尝试设置 self.window.rootViewController = viewController;没有过渡代码块,看看你是否还有问题.

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;

                }];
*/

这篇关于Xcode 11 UINavigationController 栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆