Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavBarRemoveBackgroundEffectAutomatically 在开启了 AutomaticCustomNavigationBarTransitionStyle 时可能对假 bar 无效 #1330

Closed
dongq0916 opened this issue Dec 1, 2021 · 12 comments
Labels

Comments

@dongq0916
Copy link

Bug 表现
iOS 15返回的导航动画上一个界面会有白色透明的遮罩,返回完成时消失
iOS 14以下正常

截图

RPReplay_Final1638342477.mov

如何重现

  1. A界面设置导航透明 push到导航不透明的B界面
  2. 返回时(包括手势返回)A界面导航上会有白色透明遮罩

预期的表现
返回时(包括手势返回)A界面导航上无白色透明遮罩

其他信息

  • 设备: iPhone 13 Pro Max
  • iOS 版本: [iOS 15.1]
  • Xcode 版本: [Xcode 13.1]
  • QMUI 版本: [4.4.0]
@MoLice
Copy link
Collaborator

MoLice commented Dec 1, 2021

录屏好像没内容?

@dongq0916
Copy link
Author

不好意思 这边直接上传好像有问题
我直接给录屏链接了
https://ewhj.oss-cn-shanghai.aliyuncs.com/RPReplay_Final1638342477.mov

@MoLice
Copy link
Collaborator

MoLice commented Dec 1, 2021

使用 4.4.0 是否有打开这个开关?
image

@dongq0916
Copy link
Author

开了
image

@MoLice
Copy link
Collaborator

MoLice commented Dec 1, 2021

使用最新 QMUI Demo 测试,未发现该问题。

image

配置表打开 AutomaticCustomNavigationBarTransitionStyle 的录屏,切换界面时导航栏分成左右两段,互不干扰。

AutomaticCustomNavigationBarTransitionStyle.mov

配置表关闭 AutomaticCustomNavigationBarTransitionStyle 的录屏,切换界面瞬间,导航栏会变成新界面的样式,系统默认行为如此。

AutomaticCustomNavigationBarTransitionStyle.mov

请继续排查业务代码,或者提供一份 Demo。

@dongq0916
Copy link
Author

这边简单写个了demo 还是能够复现这个问题
QMUIDemo.zip

@MoLice
Copy link
Collaborator

MoLice commented Dec 3, 2021

该问题是因为 NavBarRemoveBackgroundEffectAutomatically 开关对于转场动画过程中的 _QMUITransitionNavigationBar,会命中 UINavigationBar+QMUI.m 228 行的 if (!selfObject.superview) return;,然后后续也没人再触发 - [_UIBarBackground updateBackground] 了,导致 _QMUITransitionNavigationBarNavBarRemoveBackgroundEffectAutomatically 开关无效。在 QMUI 修复该问题之前,请在本地的 @implementation _QMUITransitionNavigationBar 里添加如下代码:

- (void)didAddSubview:(UIView *)subview {
    [super didAddSubview:subview];
    if (subview == self.qmui_backgroundView) {
        [subview qmui_performSelector:NSSelectorFromString(@"updateBackground") withArguments:nil];
    }
}

@MoLice MoLice reopened this Dec 3, 2021
@MoLice MoLice changed the title 导航动画问题 NavBarRemoveBackgroundEffectAutomatically 在开启了 AutomaticCustomNavigationBarTransitionStyle 时可能对假 bar 无效 Dec 13, 2021
@Snail-hash
Copy link

在4.4.0Demo中修改QMUICMI.automaticCustomNavigationBarTransitionStyle = YES;

@implementation _QMUITransitionNavigationBar 中添加

  • (void)didAddSubview:(UIView *)subview {
    [super didAddSubview:subview];
    if (subview == self.qmui_backgroundView) {
    [subview qmui_performSelector:NSSelectorFromString(@"updateBackground") withArguments:nil];
    }
    }
    并未修复导航栏隐藏页面跳转自定义导航栏背景页面的问题

QMUIDemo_iOS-master.zip

入口:Lab标签 -> NavBarHidden

@MoLice
Copy link
Collaborator

MoLice commented Dec 14, 2021

@Snail-hash 你说的是另一个问题,查看 #1335

@MoLice
Copy link
Collaborator

MoLice commented Dec 14, 2021

已发布 4.4.1 修复该问题。

@MoLice
Copy link
Collaborator

MoLice commented Dec 15, 2021

已发布 4.4.1 修复该问题。

不好意思,这个代码忘了带上 4.4.1,近期会再发个 4.4.2 补上

@MoLice
Copy link
Collaborator

MoLice commented Dec 23, 2021

已发布 4.4.2 修复该问题。

@MoLice MoLice closed this as completed Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants