Tencent / QMUI_iOS

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

qmui_navigationBarBackgroundImage没起作用 #1493

Closed Lazyloadingg closed 1 year ago

Lazyloadingg commented 1 year ago

我在我的swift项目中使用了QMUI,导航栏使用QMUINavigationController,控制器基类使用QMUICommonViewController,我想在不同页面设置导航栏背景色,于是我重写了qmui_navigationBarBackgroundImage方法并返回了背景图片,但是并没有生效,我单独在每个页面设置UINavigationBarAppearance这样是生效的,但是这样很麻烦,

我下载了QMUIDemo 发现demo中虽然也使用了qmui_navigationBarBackgroundImage方法,但是注释说也会在主题配置文件中查找,不使用主题配置文件的话就无法使用qmui_navigationBarBackgroundImage吗?同协议下其他方法生效,比如qmui_titleViewTintColor,只有这个无效qmui_navigationBarBackgroundImage

我重新创建了个空的OC项目,直接使用QMUINavigationController搭配,QMUICommonViewController然后在qmui_navigationBarBackgroundImage中返回背景图,依然无效

是我使用的不对吗?

MoLice commented 1 year ago

请关注配置表中的 navBarUsesStandardAppearanceOnly 相关说明。