Closed fanyuecheng closed 1 year ago
好像是pop时,
addTransitionNavigationBarAndBindNavigationBar:
->
[self.view addSubview:customBar]
->
[UINavigationBar _didMoveFromWindow:toWindow:]
->
setBackgroundImage:forBarPosition:barMetrics:
。
UINavigationBar+QMUI 中重写了 setBackgroundImage:forBarPosition:barMetrics:
并在其中为 appearance.backgroundImage
赋值,同时将该 appearance
赋值给navigationBar。
这个image
一直是[UIImage qmui_imageWithThemeManagerName:QMUIThemeManagerNameDefault provider:provider]
就在这时候,appearance
错误的赋值给了_QMUITransitionNavigationBar
。
但是正在消失的vc好像就不会触发这些操作,仅正在出现的vc才会有。
同时不知道
copyStylesToBar.standardAppearance = self.standardAppearance;
copyStylesToBar.scrollEdgeAppearance = self.scrollEdgeAppearance;
为什么没起作用
我在重写的这个方法syncAppearance
前加了判断,不知是否有问题。
if ([selfObject isKindOfClass:NSClassFromString(@"_QMUITransitionNavigationBar")]) {
return;
}
syncAppearance(selfObject, ^void(UINavigationBarAppearance *appearance) {
appearance.backgroundImage = image;
});
Bug 表现 _QMUITransitionNavigationBar 样式错误
截图
如何重现 QMUIDemo “优化导航栏在转场时的样式 ” 多次点击不同样式跳转后,返回会发现 从 “默认”到“深色”的过程中,“深色”vc的假导航栏是“默认”的蓝色,pop完成后,“深色”vc的假导航栏移除,显示了原本的灰色。
预期的表现 正常情况下,深色vc的假导航栏应该是灰色
其他信息