IOS 14中的NavigationBar颜色损坏

问题描述

我仅在一个我的应用程序中遇到此问题,并且仅在IOS 14中发生。我没有做任何更改,但是如果我将同一个应用程序安装到IOS的早期版本中,则该应用程序可以正常工作。

我的问题是当我按下另一个ViewController导航栏时,颜色闪烁为黑色或白色。我跳到上一页时是相同的。

这是我打电话去AViewController时的代码:

let storyboard = UIStoryboard(name: "Login",bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "AViewController")
let nvc = UINavigationController(rootViewController: vc)
nvc.navigationBar.shadowImage = UIImage()
nvc.navigationBar.barStyle = .default
nvc.navigationBar.isTranslucent = false
nvc.navigationBar.barTintColor = UIColor.red
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window!.rootViewController = nvc
// If I rootViewController or use push it is solid black,if I use present it is transperent white
// If present: nvc.modalPresentationStyle = .overFullScreen
// If present: self.present(nvc,animated: true,completion: nil)

这是我在推送到BViewController时调用的代码:

let storyboard = UIStoryboard(name: "Login",bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "BViewController")
self.navigationController?.pushViewController(vc,animated: true)

请帮助我。是否有人在IOS 14中面临相同的问题?下面的屏幕截图;

AViewController

When Pushing to BViewController

BViewController

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)