Tencent / QMUI_iOS

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

更换主题后,新push出不是继承自QMUICommonViewController的ViewController,标题颜色不会改变 #1348

Closed Tony-Day closed 2 years ago

Tony-Day commented 2 years ago

Bug 表现 更换主题后,新push出不是继承自QMUICommonViewController的ViewController,标题颜色不会改变

截图

https://user-images.githubusercontent.com/13215355/146363247-d5f669e4-e348-496f-b434-246050c37610.MP4

如何重现

  1. 在QMUIDemo设置某个主题的导航栏标题颜色与其他主题不同。
  2. 切换到该主题。
  3. push一个不是继承自QMUICommonViewController 的 ViewController,该ViewController的导航栏标题颜色没有改变

预期的表现 ViewController的导航栏标题颜色应为主题设置的颜色。

其他信息

MoLice commented 2 years ago

iOS 15 里当某个已被创建的 UINavigationController 实例存在后再重新应用一份新的配置表,此时比较难直接刷新该 UINavigationController 实例的导航栏样式。

像你的这种变化 theme 时要区分的样式,建议参考 QMUI Demo 配置表的写法,将其改为用 QMUIThemeColor 去实现,这样只需要写一份配置表,不用在每一份里都写一次不同的颜色。