Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.05k stars 1.37k forks source link

错误信息“We shouldn't be decreasing the API version... right?” #1469

Closed nameIsYong closed 1 year ago

nameIsYong commented 1 year ago

Bug 表现 问题的具体描述

Demo里面单独使用框架 CocoaDebug 没有任何问题,但导入QMUIKit 后,QMUIKit代码里面崩溃。 代码如下 let vc = UIStoryboard(name: "Logs", bundle: Bundle(for: CocoaDebug.self)).instantiateViewController(withIdentifier: "Logs") self.present(vc, animated: true)

截图 Bug 现场的界面截图,或者 Xcode 控制台的错误信息截图,有问题的代码截图

截图 https://github.com/nameIsYong/QMUIKit_About/blob/main/WechatIMG452.png

Demo https://github.com/nameIsYong/QMUIKit_About

如何重现 调用代码 let vc = UIStoryboard(name: "Logs", bundle: Bundle(for: CocoaDebug.self)).instantiateViewController(withIdentifier: "Logs") self.present(vc, animated: true)

预期的表现 正常情况下,应该是不在QMUIKit框架的代码里崩溃。

其他信息

MoLice commented 1 year ago

你的 Demo 是 iOS 16 的,QMUI 在 iOS 15 及以后使用系统的 UINavigationBarAppearance 来设置 UINavigationBar 的样式。而你引入的 CocoaDebug 框架自带的这几个 storyboard 里的 UINavigationBar 没有使用 UINavigationBarAppearance,所以产生了冲突。

image

简单的解决方法是逐个打开 storyboard,选中里面的 UINavigationBar,把右侧的 Standard 勾选上即可。

image